/etc/init.d/ctfweb
#! /bin/sh
# /etc/init.d/ctfweb
### BEGIN INIT INFO
# Provides:          ctfweb
# Required-Start:    $syslog
# Required-Stop:    $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: ctg web initscript
# Description:       This file starts httpd in ctf warzone
### END INIT INFO
 
 
test -f /root/httpd.pl || exit 0
 
NAME=ctfweb
DAEMON=/root/httpd.pl
PIDFILE="/var/run/httpd.pid"
DAEMON="/root/httpd.pl"
 
. /lib/lsb/init-functions
 
 
# Carry out specific functions when asked to by the system
case "$1" in
  start)
    echo "Starting ctfweb"
    start-stop-daemon --start -m -b --pidfile $PIDFILE --exec $DAEMON 
    ;;
  stop)
    echo "Stopping ctfweb"
    #echo "Could do more here"
    start-stop-daemon --stop --retry=TERM/30/KILL/5 --pidfile $PIDFILE    
    ;;
  *)
    echo "Usage: /etc/init.d/ctfweb {start|stop}"
    exit 1
    ;;
esac
 
exit 0