[plug] shell script
Adam Davin
badger at arach.net.au
Thu Jan 10 00:16:32 WST 2002
Rob,
I originally did something like this for my first ppp up scripts so that I
could update my dynamic dns entries...
Then I realised (for debian at least) that the IP address is piped to ip-up
and then ip-up.local (if you have it) as arguement $4
thus adding a line something like
echo $4 > /etc/ppp/my-ip
should stick your ip in the above mentioned file
HTH
Adam Davin
ps.
my string was
/sbin/ifconfig | grep -e ppp -A1 | grep -e inet | cut c-21-35
occasionally as the ip address was longer or shorter I'd pick up a stray
character at the end.
> -----Original Message-----
> From: Rob Dunne [mailto:robd at anville.wa.cmis.CSIRO.AU]
> Sent: Wednesday, 9 January 2002 11:35 PM
> To: plug at plug.linux.org.au
> Subject: [plug] shell script
>
>
>
> Hi list,
>
> the following is from a script from the "Security Quick-Start
> Howto". WAN_IP is not being set and the script fails
>
> but what is wrong with it? I have tried all sorts of quotes `,",' as
> well as no quote but nothing works
>
>
>
> [root at lycra]# WAN_IFACE="ppp0"
> [root at lycra]# echo $WAN_IFACE
> ppp0
> [root at lycra]# WAN_IP= `/sbin/ifconfig $WAN_IFACE |grep inet |cut
> -d : -f 2 |cut -d \ -f 1`
> bash: 130.116.4.29: command not found
> [root at lycra]# echo $WAN_IP
>
> [root at lycra]#
>
> bye
> rob
>
> --
> Rob Dunne Fax: +61 8 9333 6121 Tel: +61 8 9333 6178
> CSIRO Mathematical and Information Sciences
> Leeuwin Centre for Earth Sensing Technologies
> Private Bag 5, P.O., Wembley, Western Australia, 6913
> http://matilda.vu.edu.au/~dunne Email: Robert.Dunne at cmis.csiro.au
>
> Java has certainly revolutionized marketing and litigation.
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.313 / Virus Database: 174 - Release Date: 2/01/02
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 2/01/02
More information about the plug
mailing list