#!/bin/sh #---------------------------------------------------------------------------- # /etc/ppp/ip-down.portfw - remove all forwardings # # Creation: 24.11.2002 fm # Last Update: 14.12.2003 fm # # Copyright (c) 2002-2003 Frank Meyer # # 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/routing kernel_version=`uname -r` case "$kernel_version" in 2.2.*) if [ "$PORTFW_N" -gt 0 ] then /usr/sbin/ipmasqadm portfw -f # ipportfw: clear old tables /usr/sbin/ipmasqadm autofw -F # ipautofw: flush old tables fi ;; *) is_default_route=yes rem_pre='/var/run/portfw.rem.' if [ "$is_default_route" = "yes" -a -f ${rem_pre}default ] # is a default-route-interface going down & config-file there? then . ${rem_pre}default rm ${rem_pre}default fi if [ -f ${rem_pre}$interface ] # is there a remove-file for the interface going down? then . ${rem_pre}$interface rm ${rem_pre}$interface fi ;; esac