Fix register.cgi to work outside dbtl

This commit is contained in:
Neale Pickett 2013-06-07 21:05:26 -06:00
parent 618f00e2a8
commit 668b466414
2 changed files with 16 additions and 6 deletions

View File

@ -1,5 +1,21 @@
#! /bin/sh -e
# Change to CTF_BASE
cd ${CTF_BASE:-.}
for i in $(seq 5); do
[ -d packages ] && break
cd ..
done
if ! [ -d packages ]; then
cat <<EOF
Content-type: text/html
Cannot find CTF_BASE
EOF
exit 1
fi
# Read CGI parameters
param () {
ret=$(echo "$QUERY_STRING" | tr '=&' ' \n' | awk -v "k=$1" '($1==k) {print $2;}')
ret=$(busybox httpd -d "$ret" || echo "$ret")

View File

@ -1,6 +0,0 @@
#! /bin/sh
echo 'Content-type: application/octet-stream'
echo
tar czf - /var/lib/ctf | KEY=crashmaster arc4