i use fedora10 with linux kernel 2.6.27.9-159.fc10.i686
i m trying to make a shell script to check for my ppp0 connection every 1min
the logic i use is pretty simple...
i check if there is any ppp0 connection , using ifconfig....if ppp0 is active then i sleep for 60 seconds and recheck...if at any time ppp0 is dropped (because of my goddamn ISP!! ) then ifconfig will not mention it....and if it does not mention it...then i ll use the "ifup ppp0" command and try and reconnect ...
While your script will verify that your ppp0 connection is active, there is a better way to do it. In some cases ppp0 will still show up in the output of ifconfig but your network connectivity is non-existant.
What you should be checking is the ability to ping an ip#, popular choices for the ip# would be your ISP's nameserver. if the ping fails shutdown your ppp0 and restart it.
while true ; do
ping -c 1 nameserver_ip# || echo "restart ppp0" ;
sleep 60 ;
done
i thought \r was for carriage return....why isn't it working?
i want it to print "next check-up in 60 sec" and then overwrite that sentence with "next check-up in 59 sec" ...
i dont want it to list every second...60 through 0.
Last edited by c_d; 01-11-2009 at 12:08 AM..
Reason: removed my ip address...:D
i thought \r was for carriage return....why isn't it working?
i want it to print "next check-up in 60 sec" and then overwrite that sentence with "next check-up in 59 sec" ...
i dont want it to list every second...60 through 0.
didn't notice your post cfajohnson,your post showed up after i posted mine... thanks for an alternative...gonna try and see that too...and try to notice the difference between the two...
thanks again...
Hi all,
$ echo $SHELL
/bin/bash
Requirement - How to pass oracle sql script as argument to unix shell script?
$ ./output.sh users.sql
Below are the shell scripts and the oracle sql file in the same folder.
Shell Script
$ cat output.sh
#!/bin/bash
.... (7 Replies)
Hi team,
My requirement is to transfer pdf files from windows machine to unix server and then from that unix server we should sftp to another server.
I have completed the first part i.e From windows to using to unix server with the help of psftp.exe
code:
psftp user@host -pw password <... (1 Reply)
Can anyone help me with a dos batch script to execute a shell script residing in an unix server. I am not able to use ssh.
Thanks in advance (2 Replies)
Hi,
Is it possible to ftp a huge zip file from windows to unix server using unix shell scripting?
If so what command i need to use.
thanks in advance. (1 Reply)
Hi,
I need help urgently for following issue. Pls help me to resolve this issue.
I am calling sql script file(file1.sql) from UNIX Shell Script(script1.ksh) using sql plus and trying to create flat file that contains all records returned from SQL query in SQL script(file1.sql)
I given... (6 Replies)
Can anybody help me out in sending parameters from sql*plus script to unix shell script without using flat files..
Initially in a shell script i will call sql*plus and after getting some value from some tables, i want that variable value in unix shell script. How can i do this?
Please tell me... (2 Replies)
I want to create an automated script which is called by another maually executed script.
The condition is that the no one should be able to manually execute the automated script.
The automated script can be on the same machine or it can be on a remote machine.
Can any one suggest a check in the... (1 Reply)
Hi ,
I am having one situation in which I need to run some simple unix commands after doing "chroot" command in a shell script. Which in turn creates a new shell.
So scenario is that
- I need to have one shell script which is ran as a part of crontab
- in this shell script I need to do a... (2 Replies)