moth/packages/mcp/service/httpd/run

24 lines
431 B
Plaintext
Raw Normal View History

#! /bin/sh -e
2010-10-09 18:13:01 -06:00
exec 2>&1
hostname mcp
2011-09-23 16:04:25 -06:00
# Bring up address
IP=$(cat ip.txt)
ip addr add $IP dev eth0 || true
# Link in puzzles and web pages
2011-09-23 16:04:25 -06:00
install -d /var/www
for d in /opt/*; do
w=/var/www/$(basename $d)
if [ -d $d/puzzles ] && ! [ -d $w ]; then
ln -sf $d/puzzles $w
fi
if [ -d $d/www ]; then
2010-10-09 18:13:01 -06:00
ln -sf $d/www/* /var/www/
fi
done
exec tcpsvd -u ctf ${IP%/*} 80 /opt/mcp/bin/fnord-cgi /var/www