1
0
Fork 0
mirror of https://github.com/dirtbags/moth.git synced 2025-01-06 12:00:34 -07:00
moth/packages/mcp/service/httpd/run
2011-10-19 16:16:57 -06:00

23 lines
431 B
Bash
Executable file

#! /bin/sh -e
exec 2>&1
hostname mcp
# Bring up address
IP=$(cat ip.txt)
ip addr add $IP dev eth0 || true
# Link in puzzles and web pages
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
ln -sf $d/www/* /var/www/
fi
done
exec tcpsvd -u ctf ${IP%/*} 80 /opt/mcp/bin/fnord-cgi /var/www