The script for help, how can also determine the two iP

Such is the case, if the 10.10.10.50 online, then judging 10.10.10.51 and 10.10.10.52 two IP are online or one online open pppoe-out3, if they are not online will shut down.