files at bottom of page
ok iv made the script
it works and setup the crontab on
Dream Elite BH Phoenix Edition 2
the crontab will only work in minutes hours days months
not seconds
so i got it down to ping google every 1 minute
here is the script put in usr/script
name it ping.check.sh give it 755
Code:
ping -c 5 173.194.67.94
if [[ $? != 0 ]]; then
date '+%Y-%m-%d %H:%M:%S Connection Unavailable' >> /var/log/checkconnection.log
else
date '+%Y-%m-%d %H:%M:%S Connection Available' >> /var/log/checkconnection.log
fi
make a file in var/log
called checkconnection.log give it 644
then if your using dream elite PHOENIX
go to
var/etc/bhcron
make a file called root
inside root paste this and give it 755
*/1 * * * * /usr/script/ping.check.sh
then reboot
go to var/log checkconnection.log
and you will see that it has pinged google every one minute
and it will log like this
2012-03-27 14:36:05 Connection Available
2012-03-27 14:37:05 Connection Available
2012-03-27 14:38:05 Connection Available
2012-03-27 14:39:05 Connection Available
2012-03-27 14:40:05 Connection Available
2012-03-27 14:41:05 Connection Available
2012-03-27 14:42:05 Connection Available
2012-03-27 14:43:05 Connection Available
2012-03-27 14:44:05 Connection Available
to make it easy
iv also posted all 3 files here
just put in right places give chmod rights as above
Bookmarks