diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2010-06-01 07:45:37 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2010-06-01 07:45:37 +0000 |
commit | 20c4df200df6ca9ea8bb66b66d5ff9582ddf3446 (patch) | |
tree | e86be581f9127fbfc184c94cfddf1d7fcffd0845 | |
parent | e149170d4736017c76b09625fa9a4b6a90b5e3a3 (diff) | |
download | alpine-conf-20c4df200df6ca9ea8bb66b66d5ff9582ddf3446.tar.bz2 alpine-conf-20c4df200df6ca9ea8bb66b66d5ff9582ddf3446.tar.xz |
setup-interface: use tabs. default to dhcp
-rwxr-xr-x | setup-interfaces.in | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/setup-interfaces.in b/setup-interfaces.in index cfb4ad0..df8f231 100755 --- a/setup-interfaces.in +++ b/setup-interfaces.in @@ -20,7 +20,7 @@ get_default_addr() { echo dhcp else ip addr show $1 | awk '/inet / {print $2}' | head -n 1 | sed 's:/.*::' - fi + fi } get_default_mask() { @@ -43,6 +43,7 @@ config_iface() { local gateway while invalid_ip $address ; do address=`get_default_addr $iface` + [ -z "$address" ] && address="dhcp" echon "Ip address for $iface? (or 'dhcp') [$address] " default_read address $address [ "$address" = "abort" ] && return @@ -112,9 +113,9 @@ for i in *.conf ; do echo "auto $iface" >> interfaces echo "iface $iface inet $type" >> interfaces [ "$type" = "static" ] || continue - echo " address $address" >> interfaces - echo " netmask $netmask" >> interfaces - [ "$gateway" ] && echo " gateway $gateway" >> interfaces + echo -e "\taddress $address" >> interfaces + echo -e "\tnetmask $netmask" >> interfaces + [ "$gateway" ] && echo -e "\tgateway $gateway" >> interfaces done while [ "$answer" != "yes" ] && [ "$answer" != "no" ] ; do |