#!/usr/bin/env baships='ip1 ip2 ip3'test () { ping -t 5 -c 1 $1 if [[ $? -eq 0 ]]; then echo good # any successful ping means networking is still working exit 0 else ((++count)) fi }count=0while [[ $count -lt 3 ]]; do for i in $ips do test $i donedone# only reboot if all pings failreboot
# cat /usr/local/opnsense/service/conf/actions.d/actions_testnet.conf [check]command:/root/testnet.shparameters:type:scriptmessage:testing networkdescription:network test