fix register script in mcp

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

View File

@ -40,12 +40,12 @@ EOF
if [ -z "$hash" ] || [ -z "$team" ]; then if [ -z "$hash" ] || [ -z "$team" ]; then
echo "<p>Empty field, cannot complete request</p>" 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>" 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>" echo "<p>That hash has already been registered.</p>"
else 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>" echo "<p>Okay, your team has been named and you may begin using your hash!</p>"
fi fi