Last active
January 21, 2017 22:49
-
-
Save jadams/7844cc692b14ae0b95e10abf2fc63acd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/vbash | |
source /opt/vyatta/etc/functions/script-template | |
if !(/bin/ping -c 1 192.168.1.2 &>/dev/null) | |
then | |
if [ ! -f /config/fw.down ] | |
then | |
touch /config/fw.down | |
configure | |
delete interfaces ethernet eth1 address | |
set interfaces ethernet eth1 disable | |
delete interfaces ethernet eth2 disable | |
set interfaces ethernet eth2 address 192.168.1.1/24 | |
commit | |
fi | |
else | |
if [ -f /config/fw.down ] | |
then | |
rm -f /config/fw.down | |
configure | |
delete interfaces ethernet eth2 address | |
set interfaces ethernet eth2 disable | |
delete interfaces ethernet eth1 disable | |
set interfaces ethernet eth1 address 192.168.1.1/24 | |
commit | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment