Re: bash script that pings is not working

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

 



Anne Moore wrote:
HI All, can anyone help with this bash script? #!/bin/bash

while [ 1 ] do
ping some.ip.com
sleep 60 done

# end of script

It's not really working like I need it to be. I'm trying to add this to
everyone's logon profile and run it without the console ICMP replies showing
up while each person is connected (to keep their connections alive). Then,
once they log off, it closes the script.

Any scripting experts out there that can tweak this? Thank you so much for
your time. -Anne

Also, if you are talking about firewall timeouts then this wont actually help as the timeouts tend to be flow based, not source/dest ip based.

If they use something like putty, then you can enable tcp keepalives which will probably do what you are after.

Anyway, to answer your query.

#!/bin/bash
#

while true; do
  ping -c1 some.ip.address > /dev/null 2>&1
  sleep 60
done


--
Steve
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux