description "Setup Routing depending on several config files" author "Harald Kueller " version 1.0 emits none special start on stopped ifup console output script source /etc/init/functions if [ ! -f /etc/sysconfig/net/notrouter ]; then echo "Configuring System with routing allowed" if [ -f /etc/sysconfig/net/gateways ]; then sed -e "/^#/d" /etc/sysconfig/net/gateways | \ sed -e "/^ *$/d" >/tmp/gateways exec 3&- rm /tmp/gateways fi if [ -f /etc/sysconfig/net/defaultrouter ]; then /sbin/route add default gw `cat /etc/sysconfig/net/defaultrouter` status_message "Default Router set to `cat /etc/sysconfig/net/defaultrouter`" fi NUMIF=`/sbin/ip -f inet addr show|/bin/grep inet|/bin/grep -v "host lo"|wc -l` if [ $NUMIF -gt 2 ]; then echo "1" >/proc/sys/net/ipv4/ip_forward status_message "Enable of ip_forwarding" fi fi end script