[clug] /etc/network/interfaces
Andrew Janke
a.janke at gmail.com
Tue Nov 27 04:44:14 GMT 2007
> Hmm actually assuming you have resolvconf installed the something like:
> ---
> #!/bin/bash
>
> INTERFACE=${1:-eth0}
>
> /bin/echo -ne "auto ${INTERFACE}\n"
> /bin/echo -ne "iface ${INTERFACE} inet static\n"
> /sbin/ifconfig ${INTERFACE} | /bin/egrep 'inet addr' | \
> /bin/sed -e 's,^ *inet addr:,\taddress ,' \
> -e 's,Bcast:,\n\tbroadcast ,' \
> -e 's,Mask:,\n\tnetmask ,'
> /sbin/route -n | /usr/bin/awk '/^0.0.0.0/ {print "\tgateway",$2}'
> /bin/egrep -v '^#' /etc/resolv.conf | /bin/sed -e 's,^,\tdns-,'
> ---
>
> Will do most of what you want.
Thanks muchly Tony, I was half-way though munging
/var/lib/dhcp3/dhclient.${INTERFACE}.leases when this came in. That
accelerated my shell script writing!
Thanks again,
--
Andrew Janke (a.janke at gmail.com || http://a.janke.googlepages.com/)
Canberra->Australia +61 (402) 700 883
More information about the linux
mailing list