#!/bin/sh MWST="up" source /etc/iptables/ifnames if test -f /etc/iptables/state/mwstate then source /etc/iptables/state/mwstate fi if [ $MWST = "down" ] then logger -t "mwcheck" "Bringing mw routes back up" ip route del default PPP_PEER=`cat /etc/iptables/state/ppp_peer` if /sbin/ifconfig | grep '^ppp0' >/dev/null then ip route add default scope global nexthop via $PPP_PEER dev $WAN_IF_DSL weight 5 nexthop via $MW_GW dev $WAN_IF_MW weight 1 else ip route add default via $MW_GW dev $WAN_IF_MW fi fi echo 'MWST="up"' > /etc/iptables/state/mwstate