Page 1 of 1

Script to reboot phones

Posted: Wed Jun 19, 2019 2:55 pm
by timesecuritypr
Good day:

I need to create a script that does the following:

Condition 1

1. check if primary ISP connection is unreachable and secondary ISP connection is reachable and primary ISP connection distance is 1
2. If primary ISP connection is unreachable and second reachable, change distance of primary connection to 4, clear all firewall connections and invoke certain http links. These links will reboot the phones so they can register using the failover ISP connection.

Condition 2

1. check if primary ISP connection is reachable and primary ISP connection distance is 4
2. If primary ISP connection is reachable and primary ISP connection distance is 4, change distance of primary connection to 1, clear all firewall connections and invoke certain http links. These links will reboot the phones so they can register using the primary ISP connection.

3. Script must check every 10 seconds.

Re: Script to reboot phones

Posted: Wed Nov 20, 2019 7:44 pm
by ksthree
start by disabling eth2

you could use a netwatch, if network is down, then check if eth2 is disabled, if yes then disable enth1 enable eth2 else enable eth1 disable eth2

doing it every 10seconds could cause an issue, check to see how fast eth2 get's ip address and same for eth1.

your setup might mean this needs to be done differently