aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-11-28 10:04:15 +0000
committerRoy Marples <roy@marples.name>2007-11-28 10:04:15 +0000
commit8a328b7408e888a88c5e81ac89c10e9d267709f7 (patch)
tree0d2594456822d8d6db9d68e965087bdeaadbb01a /sh
parentf6033cfb26825322345a9dd6bbd03fb22e0424d5 (diff)
Allow whitespace in routing commands, Gentoo bug #200458.
Diffstat (limited to 'sh')
-rwxr-xr-xsh/net.sh16
1 files changed, 6 insertions, 10 deletions
diff --git a/sh/net.sh b/sh/net.sh
index 47ec2ffd..0215330f 100755
--- a/sh/net.sh
+++ b/sh/net.sh
@@ -33,7 +33,7 @@ _config_vars="config routes"
description="Configures network interfaces."
# Handy var so we don't have to embed new lines everywhere for array splitting
-__IFS="
+__IFS="
"
_shell_var() {
local rem=$1 c= r=
@@ -561,16 +561,12 @@ ${routes}"
eindent
ebegin ${cmd}
# Work out if we're a host or a net if not told
- case "${cmd}" in
+ case ${cmd} in
*" -net "*|*" -host "*) ;;
- *" netmask "*) cmd="-net ${cmd}" ;;
- *)
- case "${cmd%% *}" in
- *.*.*.*/32) cmd="-host ${cmd}" ;;
- *.*.*.*/*|0.0.0.0|default) cmd="-net ${cmd}" ;;
- *) cmd="-host ${cmd}" ;;
- esac
- ;;
+ *" netmask "*) cmd="-net ${cmd}" ;;
+ *.*.*.*/32) cmd="-host ${cmd}" ;;
+ *.*.*.*/*|0.0.0.0|default) cmd="-net ${cmd}" ;;
+ *) cmd="-host ${cmd}" ;;
esac
if ${hidefirstroute} ; then
_add_route ${cmd} >/dev/null 2>/dev/null