mirror of https://github.com/dirtbags/moth.git
fix register script in mcp
This commit is contained in:
parent
f9a46b969c
commit
a93d5be810
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue