On Thu, 17 Apr 2008 11:16:22 +1200
Kerry Mayes <[EMAIL PROTECTED]> wrote:

> I'm having difficulty with the following script:
> 
> SYNHOST=caalt04
> 
> if echo `ping -c 1 $SYNHOST` | grep -q "1 received"; then
> 
>    echo 'Synergy connected';
> 
>    ssh -2 -f -N -L 24800:$SYNHOST:24800 [EMAIL PROTECTED];
> 
>    synergyc localhost;
> 
> else
> 
>    echo 'Synergy NOT connected';
> 
> fi

Your syntax is wrong. 

if [ echo `ping -c 1 $SYNHOST` | grep -q "1 received" ]; then

or 

if test echo `ping -c 1 $SYNHOST` | grep -q "1 received"; then

will get you further. [ and test are synonymous.

Steve

Attachment: pgp1xqJI9fM52.pgp
Description: PGP signature

Reply via email to