aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-06-01 07:45:37 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-06-01 07:45:37 +0000
commit20c4df200df6ca9ea8bb66b66d5ff9582ddf3446 (patch)
treee86be581f9127fbfc184c94cfddf1d7fcffd0845
parente149170d4736017c76b09625fa9a4b6a90b5e3a3 (diff)
downloadalpine-conf-20c4df200df6ca9ea8bb66b66d5ff9582ddf3446.tar.bz2
alpine-conf-20c4df200df6ca9ea8bb66b66d5ff9582ddf3446.tar.xz
setup-interface: use tabs. default to dhcp
-rwxr-xr-xsetup-interfaces.in9
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