06-13-2010
simple script to alert if internet not working?
Hi,
I am constantly automaticaly downloading a few things on the internet but since my internet connection is unstable, it sometimes wont work. Thing is the internet will appear to be connected, but no website can be accessed and no program can successfully connect to any location. I can fix this issue once detected by turning adsl modem off and on.
So I want to write a program that detects this. So say, every 5 minutes, checks to see if internet works. I was thinking it would prob just run something like "ping www.google.com" every 5mins and if it doesnt work (ie if it cant get any information from google), it will run some file (like a mp3, to alert me).
Problem is ping keeps gettin data requests nonstop from looks of it. so how would i go about doing this? i have never done shell scripting so i dont really know how? if anyone could help me with a solution that would be great. I am using cygwin under win xp.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi everybody
I want to create 20 file using simple script - listed bellow-.
But the script doesn't work.
I hope anyone guide me to correct this script
----------------
The script
integer number=01
until (($number==21))
do
>TELE-LOG-$number
number=$number+01
echo $number
done
exit... (4 Replies)
Discussion started by: so_friendly
4 Replies
2. Shell Programming and Scripting
why won't below work?
I am trying to see
a)sipfile has username of the system.
b)it will read the sipfile and do a grep function against the /etc/passwd
c)it will save that output to /tmp/result..
but my script is just hanging...
#!/usr/bin/perl -w
open(SIPFILE, "</tmp/sipfile")
... (4 Replies)
Discussion started by: hankooknara
4 Replies
3. Shell Programming and Scripting
Hi all.
I am not a DBA. But I do have responsibility for making sure the archive logs dont fill up and cause the database. This happend the other day while I was absent (sick) and I got a good ticking off for it.
Needless to say I dont want this happen!
Could anyone lend a hand to a... (8 Replies)
Discussion started by: Incremental
8 Replies
4. Shell Programming and Scripting
So I need a script that does the following:
If a certain user is logged in
Run `command`
Else
Echo “incorrect user”
This is my first stab...which doesn't work:
#!/bin/bash
X="user=`ls -l /dev/console | cut -d " " -f 4`"
Y="foobar"
echo $X
echo $Y (4 Replies)
Discussion started by: doubleminus
4 Replies
5. Shell Programming and Scripting
hi all,
i have installed simple cgi-script
under apache/cgi-bin directory
hello.cgi
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print <<END_HTML;
<html>
<head></head>
<body>Hello, World!</body>
</html>
END_HTML
when i hit the url... (6 Replies)
Discussion started by: raghur77
6 Replies
6. Shell Programming and Scripting
Hi All,
My below shell script is not capturing %used value in the filesystem alert in the subject of the mail alert:
#!/bin/bash
export DBALIST="abc@xyz.com"
df -k /oradata/xyz/archive > dfk.result
archive_capacity=`awk -F" " '{ print $5 }' dfk.result|grep -i %| cut -c 1-4`
if ]
then... (5 Replies)
Discussion started by: a1_win
5 Replies
7. Solaris
hi ,
i have install solaris 11 on my server and using vm virtual box i have install solaris 10 on it. But on solaris 10 my internet is not working.
From my base OS solaris 11 internet is working fine but not on solaris 10. for testing purpose i have also install another os centos on Virtual... (2 Replies)
Discussion started by: zeeshan047
2 Replies
8. Shell Programming and Scripting
Hi all,
Please guide me writing this script
Follwing is the file which I have created, which contains the files to be copied.
cat system1-dr.txt
/etc/passwd
/etc/shadow
/etc/group
/etc/vfstab
/etc/profile
/etc/default/init
/etc/shells
/etc/dfs/dfstab
/etc/dfs/sharetab... (11 Replies)
Discussion started by: manalisharmabe
11 Replies
9. Shell Programming and Scripting
I have the below sftp script to transfer a file from a linux host(source) to another linux host(target). Public key is already set up in target host and I am able to transfer file using sftp from source to target.
But not sure why the below script(ftp_script) is not working.
Any help in this... (3 Replies)
Discussion started by: Armaan
3 Replies
10. Shell Programming and Scripting
Hi All,
My below shell script is not capturing %used value in the filesystem alert in the subject of the mail alert:
Code:
#!/bin/bash
export DBALIST="abc@xyz.com"
df -k /oradata/xyz/archive > dfk.result
archive_capacity=`awk -F" " '{ print $5 }' dfk.result|grep -i %| cut -c 1-4`
if... (6 Replies)
Discussion started by: harveyclayton
6 Replies
LEARN ABOUT REDHAT
wvdialconf
WVDIALCONF(1) General Commands Manual WVDIALCONF(1)
NAME
wvdialconf - build a configuration file for wvdial(1)
SYNOPSIS
wvdialconf /etc/wvdial.conf
DESCRIPTION
wvdialconf detects your modem, its maximum baud rate, and a good initialization string and generates or updates the wvdial(1) configuration
file based on this information.
wvdialconf is completely non-interactive. You still need to edit /etc/wvdial.conf to specify the phone number, login name, and password of
your internet account in order for wvdial(1) to work.
It is safe to run wvdialconf if a configuration file already exists. In that case, only the Modem, Baud, Init, and Init2 options are
changed in the [Dialer Defaults] section, and only if autodetection is successful.
BUGS
We're willing to entertain the possibility. Let us know if you have any problems by sending an e-mail to <wvdial@nit.ca>.
Also, there is now a mailing list for discussion about wvdial. If you are having problems, or have anything else to say, send e-mail to
<wvdial-list@lists.nit.ca>.
DIAGNOSTICS
An exit status of 0 means that a modem was detected and the configuration file was updated successfully.
Any other value means that something went wrong and the configuration file was unchanged.
AUTHORS
Dave Coombs and Avery Pennarun for Net Integration Technologies, as part of the Worldvisions Weaver project.
SEE ALSO
wvdial(1), wvdial.conf(5).
Worldvisions August 1998 WVDIALCONF(1)