Jump to content

ping or reboot


 Share

Recommended Posts

im a admin at a open learning center and we are in desperate need for a program that pings a server and if the netcable are disconnected it had to reboot.

my problem is that if i do a _RunDOS($ping xxx.xx.xx.xx) can i get a return value, if it cant ping it ?

or is there a smarter method?

i was thinking about something like this

sleep(50000) ;gives the user 50 sec to start up

while(1)

_runDOS($ping xxx.xxx.xx.xx)

if RETURNVALUEHERE = 1 then

shutdown(5)

else

sleep(10000)

WEnd

is it possible?

thx in advance

Link to comment
Share on other sites

I guess the smarter method would be to use the ping function found in the help file

$var = Ping("www.AutoItScript.com",250)
If $var Then; also possible:  If @error = 0 Then ...
    Msgbox(0,"Status","Online, roundtrip was:" & $var)
Else
    Msgbox(0,"Status","An error occured with number: " & @error)
EndIf
Edited by creeping
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...