#---------------------------------------------------------------------------- # /var/install/include/restore-route - configuration of additional routes # # Creation : 2022-12-29 hbfl # Last Update: $Id$ # # Copyright (c) 2001-@@YEAR@@ 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. #---------------------------------------------------------------------------- # # update the route after a special package was stopped to restore default settings # included from bonding, brigde, etc.. # idx=1 while [ ${idx} -le ${IP_ROUTE_N:-0} ] do eval route='${IP_ROUTE_'${idx}'}' set ${route} net=${1} netmask=${2} gw=${3} netmaskbits=$(/usr/bin/netcalc netmaskbits ${net}:${netmask}) /usr/sbin/ip route add ${net}/${netmaskbits} via ${gw} idx=$((${idx} + 1)) done if [ -n "${IP_DEFAULT_GATEWAY}" ] then /usr/sbin/ip route add default via ${IP_DEFAULT_GATEWAY} fi