[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: a script for pinging machine on the network.



Le Samedi 27 Juillet 2002 20:07, ThanhVu Nguyen a écrit :
> One of my computer has this (annoying) feature that it will turn the
> nic off if being idle for couple hours.  The only way to restart is to
> physically hit the keyboard.  So I am thinking that a little small
> ping script that pings this machine every 30 minutes will help cure
> the problem. Can someone give me such script ?  Thanks
If you have cron installed on your computer put this file in /etc/cron.d/
cron.ping:

# /etc/cron.d/cron.ping: crontab fragment for pinging
# Ping Machine every 30 minutes
*/30 *     * * *     root   ping -c 1 your_machine 1>/dev/null


If you don't have cron
Here's the script you asked:

#! /bin/sh
typeset -i toto=0
while [ $toto ]
do
ping -c 1 machine 1>/dev/null
sleep 1800
done

Don't forget to replace 'machine' by the name or the IP address of the 
computer who has problem :)


-- 
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: