mirror of https://github.com/dirtbags/moth.git
more register fixes
This commit is contained in:
parent
f8953e758c
commit
f3a6bc1393
|
@ -22,13 +22,15 @@ Content-type: text/html
|
||||||
<h1>Team Registration</h1>
|
<h1>Team Registration</h1>
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if ! grep -q $hash $CTF_BASE/state/teams/assigned.txt; then
|
if [ -z "$hash" ]; then
|
||||||
echo "<p>That token has not been assigned.</p>"
|
echo "<p>Empty hash, cannot complete request</p>"
|
||||||
|
elif ! grep -q $hash $CTF_BASE/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 $CTF_BASE/state/teams/names/$hash ]; then
|
||||||
echo "<p>That token has already been registered.</p>"
|
echo "<p>That hash has already been registered.</p>"
|
||||||
else
|
else
|
||||||
printf "%s" "$team" > $CTF_BASE/state/teams/names/$h
|
printf "%s" "$team" > $CTF_BASE/state/teams/names/$hash
|
||||||
echo "<p>Okay, your team has been named and you may begin using your token!</p>"
|
echo "<p>Okay, your team has been named and you may begin using your hash!</p>"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
Loading…
Reference in New Issue