#!/bin/sh

### BEGIN INIT INFO
# Provides:          firewall-supplement
# Required-Start:    $local_fs $syslog
# Required-Stop:     $syslog
# Should-Start:      lxc-net
# Default-Start:     2 3 4 5
# Default-Stop:      
# Short-Description: Set up firewall in the old iptable fashion supplementary to any other setup
### END INIT INFO


set -e

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

case "$1" in
  start|restart|reload|force-reload)
      /usr/local/bin/firewall-supplement.pl --booting
      ;;
  stop)
      # remove cache (if not symlink)
      [ ! -L /tmp/firewall-supplement ] && [ -e /tmp/firewall-supplement ] && rm -f /tmp/firewall-supplement
      ;;
  *)
      echo "Not doing anything. Really."
      ;;
esac

exit 0
