diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2010-09-14 07:49:41 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2010-09-14 07:49:41 +0000 |
commit | f323e578cd5941d5eaaed2d46799701b54dd6165 (patch) | |
tree | 7e4dd027bf341aaf8a3f422ec0d7dd0e752077e2 /main/util-vserver/setup-vs-guest | |
parent | e1475bb75134c02a8cd52b518069f010edbaaabe (diff) | |
download | aports-f323e578cd5941d5eaaed2d46799701b54dd6165.tar.bz2 aports-f323e578cd5941d5eaaed2d46799701b54dd6165.tar.xz |
util-vserver: fix setup-vs-guest script for busybox-1.17.x
Diffstat (limited to 'main/util-vserver/setup-vs-guest')
-rw-r--r-- | main/util-vserver/setup-vs-guest | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/main/util-vserver/setup-vs-guest b/main/util-vserver/setup-vs-guest index 2985af96f5..5b71e08067 100644 --- a/main/util-vserver/setup-vs-guest +++ b/main/util-vserver/setup-vs-guest @@ -156,9 +156,9 @@ last_ipv4_addr_mask() { ip addr show dev $_iface | awk '$1 == "inet" {print $2}' | tail -n1 } -valid_ip() { +valid_ip_and_prefix() { [ "$1" ] || return 0 - ipcalc -s $1 + ipcalc -s -m $1 >/dev/null 2>&1 && ! ipcalc -s -m $1/0 >/dev/null 2>&1 } # ask for hostname @@ -208,7 +208,7 @@ ask_ifaceopts() { _mask=${_last_ip_mask#*/} while true; do ask "Enter IP address/mask for $_iface:" $_ip/$_mask - valid_ip $resp && break + valid_ip_and_prefix "$resp" 2>&1 && break echo "$resp is not a valid IPv4 address/mask" done _ip_mask=$resp |