#! /bin/sh #---------------------------------------------------------------------------- # /etc/rc.d/route - configuration of additional routes # # Creation : 2001-10-15 fm # Last Update: $Id$ # # Copyright (c) 2001-2012 the eisfair team, team(at)eisfair(dot)org # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- . /etc/config.d/base . /etc/init.d/functions if [ "$ROUTE_DO_DEBUG" = yes ] then set -x fi case $1 in start) boot_mesg " * Setting up additional routes ..." idx=1 while [ "$idx" -le "$IP_ROUTE_N" ] do eval route='$IP_ROUTE_'$idx set $route net=$1 netmask=$2 gw=$3 route add -net $net netmask $netmask gw $gw idx=`/usr/bin/expr $idx + 1` done if [ "$IP_DEFAULT_GATEWAY" != "" ] then route add default gw $IP_DEFAULT_GATEWAY fi evaluate_retval ;; stop) boot_mesg " * Deleting additional routes ..." idx=1 while [ "$idx" -le "$IP_ROUTE_N" ] do eval route='$IP_ROUTE_'$idx set $route net=$1 netmask=$2 gw=$3 route del -net $net netmask $netmask gw $gw idx=`/usr/bin/expr $idx + 1` done if [ "$IP_DEFAULT_GATEWAY" != "" ] then route del default gw $IP_DEFAULT_GATEWAY fi evaluate_retval ;; esac set +x