Why doesn't this script work? (NOT DFly specific)

Rahul Siddharthan rsidd at online.fr
Thu Feb 19 22:46:00 PST 2004


Jonathon McKitrick said on Feb 19, 2004 at 23:19:54:
> 
> rc=2
> netstat -rn | grep -q tun
> retval=$?
> 
> # if not, dial in
> if [ $retval -eq 0 ]; then
                  ^^
I think you have that wrong... grep -q returns 0 if there's a match
(as indeed it does without -q too: 1 if no match, 2 if error), so
you'll be trying to dialup only when you find a tun interface, not
when you don't.

> echo Connecting...
> ppp -ddial nerc
> sleep 60
> fi
> 
> echo Updating ports collection
> /usr/local/bin/cvsup -g -L0 /home/jcm/.admin/ports-supfile


Rahul





More information about the Kernel mailing list