mirror of https://github.com/dirtbags/moth.git
24 lines
431 B
Bash
Executable File
24 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
|