#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
 
ifconfig eth1 10.250.20.63 netmask 255.255.255.0 broadcast 10.250.20.255

route add -net 10.250.21.0/24 gw 10.250.20.250

if [ -x /var/qmail/rc ]; then
  csh -cf /var/qmail/rc &
  echo "qmail server started."
fi

if [ -x /usr/local/bin/tcpserver ]; then
  /usr/local/bin/tcpserver
  echo "tcpserver (smtp) started."
fi

/usr/local/bin/tcpserver -R -H -l0 -x /etc/tcp.smtp.cdb -v -u 1003 -g 1003 0 smtp /var/qmail/bin/qmail-smtpd 2>&1 | /var/qmail/bin/splogger smtpd 3 &

if [ -x /usr/local/apache2/bin/apachectl ]; then
  /usr/local/apache2/bin/apachectl start
  echo "Apache http server started."
fi

exit 0
