mirror of https://github.com/dirtbags/moth.git
Switch to thttpd + a few fixes
This commit is contained in:
parent
8a43dbb37a
commit
9769a453e9
|
@ -98,7 +98,7 @@ for dn in $indir/[0-9]*; do
|
||||||
# Append keys
|
# Append keys
|
||||||
if [ -f $dn/key ]; then
|
if [ -f $dn/key ]; then
|
||||||
while read answer; do
|
while read answer; do
|
||||||
echo $points $answer >> $uanswers
|
[ -n "$answer" ] && echo $points $answer >> $uanswers
|
||||||
done < $dn/key
|
done < $dn/key
|
||||||
else
|
else
|
||||||
echo "$dn/key: No such file or directory" 1>&2
|
echo "$dn/key: No such file or directory" 1>&2
|
||||||
|
|
|
@ -1,53 +0,0 @@
|
||||||
Umask 026
|
|
||||||
|
|
||||||
Log /dev/stdout
|
|
||||||
ErrorLog /dev/stderr
|
|
||||||
|
|
||||||
User nobody
|
|
||||||
StayRoot On
|
|
||||||
|
|
||||||
LogFormat {
|
|
||||||
RemoteAddress
|
|
||||||
Method
|
|
||||||
URI
|
|
||||||
Status
|
|
||||||
ContentLength
|
|
||||||
Referer
|
|
||||||
UserAgent
|
|
||||||
}
|
|
||||||
|
|
||||||
Tuning {
|
|
||||||
Timeout 5
|
|
||||||
ScriptTimeout 5
|
|
||||||
}
|
|
||||||
|
|
||||||
Control {
|
|
||||||
ScriptUser ctf
|
|
||||||
|
|
||||||
Types {
|
|
||||||
"text/html; charset=utf-8" { .html }
|
|
||||||
"text/plain; charset=utf-8" { .txt }
|
|
||||||
text/css { .css }
|
|
||||||
image/png { .png }
|
|
||||||
image/jpeg { .jpg }
|
|
||||||
image/gif { .gif }
|
|
||||||
application/javascript { .js }
|
|
||||||
application/octet-stream { * }
|
|
||||||
}
|
|
||||||
Specials {
|
|
||||||
CGI { .cgi }
|
|
||||||
}
|
|
||||||
IndexNames { index.html }
|
|
||||||
}
|
|
||||||
|
|
||||||
Server {
|
|
||||||
Address 10.0.0.2
|
|
||||||
|
|
||||||
Virtual {
|
|
||||||
AnyHost
|
|
||||||
Control {
|
|
||||||
Alias /
|
|
||||||
Location /var/www
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -14,5 +14,11 @@ for d in /opt/*; do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
exec mathopd -n -f ./mathopd.conf
|
cd /var/www
|
||||||
|
exec thttpd -D \
|
||||||
|
-h 10.0.0.2 \
|
||||||
|
-c "**.cgi" \
|
||||||
|
-u ctf \
|
||||||
|
-l /proc/self/fd/1 \
|
||||||
|
-T UTF-8 \
|
||||||
|
-nos
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
port=8888
|
port=8888
|
||||||
host=10.0.0.10
|
host=10.0.0.8
|
||||||
|
|
||||||
blooper=$(tempfile)
|
blooper=$(tempfile)
|
||||||
trap "rm $blooper" 0
|
trap "rm $blooper" 0
|
||||||
|
|
||||||
echo foo | socat -t 0.01 STDIO UDP:$host:$port | tail -n +4 > $blooper
|
echo foo | socat -t 0.01 STDIO UDP:$host:$port | tail -n +5 > $blooper
|
||||||
|
|
||||||
for i in $(seq 8); do
|
for i in $(seq 8); do
|
||||||
result=$(socat -t 0.01 STDIO UDP:$host:$port < $blooper | awk -F': ' '(NF > 1) {print $2; exit;}')
|
result=$(socat -t 0.01 STDIO UDP:$host:$port < $blooper | awk -F': ' '(NF > 1) {print $2; exit;}')
|
||||||
port=$(echo "ibase=8; $result" | bc)
|
port=$(echo "ibase=8; $result" | bc)
|
||||||
echo $port
|
echo "next port: $port ($result)"
|
||||||
done
|
done
|
||||||
echo $result
|
echo $result
|
|
@ -0,0 +1,4 @@
|
||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
exec svlogd -tt $PWD
|
||||||
|
|
|
@ -8,5 +8,5 @@ exec /opt/router/sbin/dnsmasq \
|
||||||
--keep-in-foreground \
|
--keep-in-foreground \
|
||||||
--conf-file=dnsmasq.conf \
|
--conf-file=dnsmasq.conf \
|
||||||
--pid-file= \
|
--pid-file= \
|
||||||
--log-facility=/dev/stdout
|
--log-facility=/proc/self/fd/1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue