mirror of https://github.com/dirtbags/moth.git
make register.cgi actually return
This commit is contained in:
parent
9c4563b122
commit
af36a4c633
|
@ -3,6 +3,7 @@
|
||||||
param () {
|
param () {
|
||||||
ret=$(echo "$QUERY_STRING" | tr '=&' ' \n' | awk -v "k=$1" '($1==k) {print $2;}')
|
ret=$(echo "$QUERY_STRING" | tr '=&' ' \n' | awk -v "k=$1" '($1==k) {print $2;}')
|
||||||
ret=$(busybox httpd -d "$ret" || echo "$ret")
|
ret=$(busybox httpd -d "$ret" || echo "$ret")
|
||||||
|
echo "$ret"
|
||||||
}
|
}
|
||||||
|
|
||||||
team=$(param n)
|
team=$(param n)
|
||||||
|
@ -21,12 +22,12 @@ Content-type: text/html
|
||||||
<h1>Team Registration</h1>
|
<h1>Team Registration</h1>
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if ! grep -q $h $CTF_BASE/state/teams/assigned.txt; then
|
if ! grep -q $hash $CTF_BASE/state/teams/assigned.txt; then
|
||||||
echo "<p>That token has not been assigned.</p>"
|
echo "<p>That token has not been assigned.</p>"
|
||||||
elif [ -f $CTF_BASE/state/teams/names/$h ]; then
|
elif [ -f $CTF_BASE/state/teams/names/$hash ]; then
|
||||||
echo "<p>That token has already been named.</p>"
|
echo "<p>That token has already been registered.</p>"
|
||||||
else
|
else
|
||||||
printf "%s" "$t" > $CTF_BASE/state/teams/names/$h
|
printf "%s" "$team" > $CTF_BASE/state/teams/names/$h
|
||||||
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 token!</p>"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue