• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Can someone help me write a *really* simple script

Specop 007

Diamond Member
Ok, a scripter/coder I most certainly am not.
What i want is a script to ping an IP address once every X interval. 1 or 2 minutes with say 3 pings.

The idea is to use it to keep a timeout from kicking me off a network. I know how to make the .exe file and I know how to set it to ping an IP address, but how do I set an interval for it and then loop it back around?

Thanks.
 
You could use a batch file.

@echo off
:start
@ping -n 3 [ip address]
@sleep 60
goto start
 
I assume you're talking about a korn shell script? (or bash if you're un Linux)

just do something like this ...
#!/bin/ksh
# sends 3 pings every 90 seconds
while [ true ]
do
ping -c 3 $HOSTNAME
sleep 90
done

Or if you want to do it all on one line, the ping utility by default will go on forever, and just set the interval higher ...

use
#sends 1 ping every 60 seconds
ping -i 60 $HOSTNAME


You should really specify what operating system this is for.
Also, this should probably be in a different forum. Maybe networking because ping is networking software, or maybe software, or maybe operating systems, as the ping utility and scripting language varies a lot between different OSes.

 
Originally posted by: BurnItDwn
You should really specify what operating system this is for.
Yeah. I assumed Windows since he mentioned `.exe file', but who knows. 😛
 
Originally posted by: xcript
Originally posted by: BurnItDwn
You should really specify what operating system this is for.
Yeah. I assumed Windows since he mentioned `.exe file', but who knows. 😛

DOH .....
I see .exe and I just think "executable file, or binary file" .... not even realizing that he meant "file that ends with a dot exe extension"

Disreguard my post.

I have no idea how to do this in windows.
 
Back
Top