fix register script in mcp

This commit is contained in:
Neale Pickett 2013-07-10 23:22:12 -05:00
parent ea169f6c1f
commit efacc951a0
1 changed files with 3 additions and 3 deletions

View File

@ -40,12 +40,12 @@ EOF
if [ -z "$hash" ] || [ -z "$team" ]; then
echo "<p>Empty field, cannot complete request</p>"
elif ! grep -q " $hash$" $CTF_BASE/state/teams/assigned.txt; then
elif ! grep -q "^$hash$" state/teams/assigned.txt; then
echo "<p>That hash has not been assigned.</p>"
elif [ -f $CTF_BASE/state/teams/names/$hash ]; then
elif [ -f state/teams/names/$hash ]; then
echo "<p>That hash has already been registered.</p>"
else
printf "%s" "$team" > $CTF_BASE/state/teams/names/$hash
printf "%s" "$team" > state/teams/names/$hash
echo "<p>Okay, your team has been named and you may begin using your hash!</p>"
fi