Adding after "chmod +x /tmp/checklink" in the startup script:
Code:
echo "0">/tmp/def.rt
echo "echo \"\$2\"> /tmp/def.rt
route del default dev ppp\$1
route add default dev ppp\$2"> /tmp/setdr
chmod +x /tmp/setdr
This creates a script setdr <from connection> <to connection>
The firewall script runs after every reconnect, so to restore the desired changes, add this code to the firewall script after "/tmp/build.wall":
Code:
/tmp/setdr 0 `cat def.rt`
Either run /tmp/setdr directly from the GUI command box (for immediate effect) and/or schedule changes in the GUI cron box:
Code:
0 18 * * 1-5 root/tmp/setdr 0 2
0 6 * * 1-5 root/tmp/setdr 2 0
Bookmarks