# shorewall
#
# starts shorewall

description	"Start shorewall"
author		"Arjan Bouter <abouter@sourcemage.org>"

start on network-up
stop on shutdown

task
console output

script
  . /etc/sysconfig/shorewall

  # Shorewall needs /var/log/messages to exist
  if  [[  !  -f  /var/log/messages  ]]
  then
    touch  /var/log/messages
  fi  &&
  # Create shorewall log file if it doesn't exist
  if  [[  !  -f  $SHOREWALL_LOG  ]]
  then
    touch  $SHOREWALL_LOG
  fi  &&
  # Shorewall needs subsys
  if  [[  !  -d  /var/lock/subsys/  ]]
  then
    mkdir  -p  /var/lock/subsys/
  fi  &&
  date "$DATE_FORMAT"  >>  $SHOREWALL_LOG 2>&1
  shorewall start >> $SHOREWALL_LOG 2>&1
end script
