Hi,
Just to give some starting point, create a new shell script (new.sh for
example). An example shell script would be:
----
#!/bin/sh
# The 1 should be replaced with some condition
while [ 1 ]
do
echo "Sending 3 ping packets..."
# Ping www.yahoo.com 3 times, then see if "0 received" exists
stringvariable=$(ping -c 3 www.yahoo.com | grep '0 received')
stringlength=$(expr length "$stringvariable")
# Check the length of string
if [ "$stringlength" == "0" ]; then
# Here should be the command when ping works
echo "Ping works more or less..."
else
# When "0 received" was found somewhere...
echo "Ping failed..."
# Here should be the command for the DIO pin
fi
# Sleep for 30 seconds before going back to the beginning
sleep 30
done
----
Unfortunately, I don't know how to toggle a DIO pin on TS-7350.
Jaan
--- In "ysuwansiri" <> wrote:
>
> 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
<*> 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/
|