1
0
Fork 0
mirror of https://github.com/dirtbags/moth.git synced 2025-01-06 03:50:56 -07:00
moth/packages/mcp/service/httpd/run
2011-10-12 17:41:19 -06:00

21 lines
407 B
Bash
Executable file

#! /bin/sh
exec 2>&1
# Bring up address
IP=$(cat ip.txt)
ip addr add $IP dev eth0
ip monitor | grep -q $IP
# Link in puzzles and web pages
install -d /var/www
for d in /opt/*; do
if [ -d $d/puzzles ]; then
ln -sf $d/puzzles /var/www/$(basename $d)
fi
if [ -d $d/www ]; then
ln -sf $d/www/* /var/www/
fi
done
exec tcpsvd -u ctf ${IP%/*} 80 /opt/mcp/bin/fnord-cgi /var/www