Are you sure you want to ping yahoo.com? You might do better to ping your
default router, or ping a host under your control. What if yahoo.com decides
that too many people are pinging it, and turns off pinging?
No matter what host you end up pinging, if you say "ping -c 5 example.com",
then ping will try once a second for five seconds to ping the host. If even one
ping reply returns, it will return success. If none return, then failure. I
would use a script like this. No guarantee this will work unless you want to
pay me for a guarantee.
#!/bin/sh
export model=3
. ts7xxx.subr
export PATH=$PATH:/initrd/bin
dio_dir_set 0 1
if ping -c 5 example.com; then echo "Hooray, it worked."; dio_data_set 0 0
else dio_data_set 0 1
fi
________________________________________
From: on behalf of ysuwansiri
Sent: Monday, February 06, 2012 11:55 AM
To:
Subject: [ts-7000] Output 5VDC from DIO line
I have a TS7350 board, and I would like to know how I could write a script to
"If ping yahoo.com fails, then TS7350 outputs 5VDC from its DIO line". Please
advise...
Arm
------------------------------------
Yahoo! Groups Links
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|