[GLLUG] Help with a script..

Jean van Wyngaardt gabrieldrumming at gmail.com
Mon Jan 6 20:36:50 UTC 2014


Thanks Stuart

The error coming up is this:

/home/ladmin/Desktop/vpn.sh: 7: /home/ladmin/Desktop/vpn.sh: Syntax error: "else" unexpected

Appreciate your help on this. Like you say, it probably needs a "do nothing" type entry. What do you suggest?

Jean 

Jean van Wyngaardt 

07599 428068 
info at jeangabriel.co.uk 
http://runlevel.co.uk 
http://mactribe.co.uk

On 6 Jan 2014, at 20:27, Stuart Sears <stuart at sjsears.com> wrote:

> On 06/01/14 20:17, Jean van Wyngaardt wrote:
>> Hey guys
>> 
>> Working out this VPN script and it won't run because of line 7 (highlighted in bold below). Seeing as my scripting knowledge is limited, I thought I might check with you!
> 
> for questions like this, it helps enormously if you also paste the error
> message you receive :)
> 
>> #!/bin/sh
>> while [ "true" ]
>> do
>>    vpnck=$(nmcli con status uuid 3e46a1d0-ab02-4d69-bd36-31dfcc01af6d)
>>    if [[ $vpnck == *cryptocloud* ]]
>>    then
> 
> Surely there should be something here, no?
> What do you expect the script to do if this condition is true?
> Even a "that's okay, do nothing command" would be okay.
> 
>>    else
>>      (sleep 1s && nmcli con up uuid 3e46a1d0-ab02-4d69-bd36-31dfcc01af6d)
>>    fi
>>    sleep 20
>> done
> 
> Regards,
> 
> Stuart
> 
> -- 
> Stuart Sears RHCA etc.
> "It's today!" said Piglet.
> "My favourite day," said Pooh.
> 
> _______________________________________________
> GLLUG mailing list
> GLLUG at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/gllug

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20140106/768f0a51/attachment.html>


More information about the GLLUG mailing list