1

simple while loop script to check a connection

view story
linux-howto

http://www.unix.com – Hi, I am completely new to shell scripting. Basically I am wanting to create a simple while loop script to check if a network connection is available from 'netstat -a' and if its present then output a character to the serial port. I think i am nearly there.. but need some assistance.. this is what i have so far..(ip address an example).. #!/bin/bash CONNECTED=$(netstat -a | grep -c 1.1.1.1) while [echo $CONNECTED -gt 0]; do echo -n p >/dev/ttyS1; sleep 20; done Many thanks Zippy (HowTos)