* [gentoo-user] crontab every 2 minutes to execute net.ppp restart
@ 2013-01-25 15:49 Tamer Higazi
2013-01-25 16:17 ` Michael Orlitzky
0 siblings, 1 reply; 2+ messages in thread
From: Tamer Higazi @ 2013-01-25 15:49 UTC (permalink / raw
To: gentoo-user
Hi people,
I want my gentoo machine to check every 5 minutes the connection status.
Therefor I wrote a shell script:
-----
#!/bin/bash
#set -x
dnsbroken=`ping -c1nqW5 -s8 mydomain.com 2>&1 | grep -e "unknown" -e
"denied" -e "permited"`
if [ -n "$dnsbroken" ]
then
# reconnect the connection
/etc/init.d/net.ppp0 restart
fi
exit 0
----
to check if the connection exists, and if not restarts the init.ppp0
script.
This script I made it root:root and permission: 500
on crontab:
0-59/5 * * * * /usr/sbin/bash_ppp
The problem:
when the connection is down, even after 5 minutes or 10, the script
isn't being executed, when I execute it by hand it works!
Any ideas?!
Tamer
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [gentoo-user] crontab every 2 minutes to execute net.ppp restart
2013-01-25 15:49 [gentoo-user] crontab every 2 minutes to execute net.ppp restart Tamer Higazi
@ 2013-01-25 16:17 ` Michael Orlitzky
0 siblings, 0 replies; 2+ messages in thread
From: Michael Orlitzky @ 2013-01-25 16:17 UTC (permalink / raw
To: gentoo-user
On 01/25/13 10:49, Tamer Higazi wrote:
>
> on crontab:
> 0-59/5 * * * * /usr/sbin/bash_ppp
>
Try */5 and restart cron.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-25 16:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-25 15:49 [gentoo-user] crontab every 2 minutes to execute net.ppp restart Tamer Higazi
2013-01-25 16:17 ` Michael Orlitzky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox