LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 12-02-2002, 10:22 PM   #1
ubien
Member
 
Registered: Oct 2002
Distribution: RH 8.0 and fluxbox
Posts: 122

Rep: Reputation: 15
if (ping host = true) killall wine, how?


this goes out to all your hardcore shell scripters.....anyway to do this? I run WinMX with wine, but my dad likes to play Q3 and if its running it lags really bad. What I would like to do is have script / program that pings an IP every...30 seconds or so, and if it returns true, issues the command killall wine. Possible?
 
Old 12-03-2002, 02:35 AM   #2
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 46
You can run the following script from cron every X seconds. Just modify it to run the right command. You might also want to change the timeouts on the ping command.

Code:
#!/bin/sh

/bin/ping -c 2 somehostname &> /dev/null

if [ $? != 0 ]
then
    echo "Run some command"
fi
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ping host unreachable czyang4 Linux - Networking 2 04-20-2005 02:58 PM
Return true or false if I have ping reply Menestrel Programming 4 11-29-2004 12:40 AM
PPP establish can ping the gateway router but unable to ping the host deepalalla Linux - Networking 0 11-18-2004 09:10 AM
Unknown Host <Linuxmachinename> / Unable to ping by host name nishi_k_79 Linux - Networking 4 11-01-2003 01:24 PM
ping works, host works, ping host does not dublin212 Linux - Networking 3 03-31-2003 11:38 PM


All times are GMT -5. The time now is 01:03 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration