moth/packages/mcp/service/httpd/run

26 lines
447 B
Plaintext
Raw Normal View History

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