I have dialup connection with dynamic ip address, i want to replace the old ip address with the new ip address in the ipsec.conf which is in the 18th line:
This is a code the print the new external ip address with each dialup connection:
Quote:
EXTIF="ppp0"
IFCONFIG=/sbin/ifconfig
AWK=/usr/bin/awk
EXTIP="`$IFCONFIG $EXTIF 2>/dev/null | $AWK \
/$EXTIF/'{next}//{split($0,a,":");split(a[2],a," ");print a[1];exit}'`"
echo "$EXTIP"
|
how to use a code with one of cat, echo or sed commands to replace the above line with the ouput of this new ip address?