#!/bin/sh # #Check portsentry status sh /usr/local/bin/sentry # Script to check if modem is disconnected & try reconnecting # #Checks the status of device dsl0 for the word 'disconnect' and stores the #result in a variable called 'result' result=$(cinternet -i ppp0 -s | grep disconnect) #Test to see if the value is not NULL if [ -n "$result" ] then #OK the interface is down so shutdown mld echo -e "kill\nq\n" | netcat 127.0.0.1 4000 sleep 4 #Start the interface. cinternet -i ppp0 -A sleep 10 #Restart mld sh /usr/local/bin/mld sleep 4 #The interface is up - Just exit exit 0 fi