I need a script to check the dialup internet connection if it is disconnected will run the pon, when get connected exit the script, but if connection fails will try 3 times to connect, finally after third fail of try sould shutdown the computer. this is the one i get but it is not working and i want to be simple pretty script:

Quote:

#!/bin/bash

WTIME="60"

#here I defined the logfile's locationlogfile=/home/user/pppd/con.log

#the heart of this script lies right here#just ping google.com with one packet, pipe it's stderr to egrep and match either of those words#egrep's -c tells to output the number of matchesstatus=$(ping -c 1 google.com 2>&1 | egrep -c "\<unknown\>|\<unreachable\>")

Who is online

Users browsing this forum: No registered users and 4 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum