i want to configure failover between WAN interface to Modem interface based on ICMP.
i add the following script but this based on interface status so in case that the interface is up but without internet, the failover will not apply.
Script to use
# disable the cellular modem connection if WAN is up # enable the cellular modem connection if WAN is down
wan_iface_state="$(runt get network.interface.$wan_iface_name.ipv4.up)"
case "$wan_iface_state" in
1) # up
config set network.interface.$modem_iface_name.enable false
0) # down
config set network.interface.$modem_iface_name.enable true
*) # unknown state
accns_log w config "custom test: unknown state for $wan_iface_name interface ($wan_iface_state)"
end of script
Someone have a script which based on ICMP samples?