Edit addresses in interactive commands

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5147 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2006-12-21 21:10:18 +00:00
parent 04f2417ad8
commit a07797bdac

View File

@ -755,7 +755,8 @@ case "$COMMAND" in
usage 1 usage 1
fi fi
[ -z "$vlsm" ] && exit 2 valid_address $address || fatal_error "Invalid IP address: $address"
if [ -z "$vlsm" ] && exit 2
[ "x$address" = "x$vlsm" ] && usage 2 [ "x$address" = "x$vlsm" ] && usage 2
[ $vlsm -gt 32 ] && echo "Invalid VLSM: /$vlsm" >&2 && exit 2 [ $vlsm -gt 32 ] && echo "Invalid VLSM: /$vlsm" >&2 && exit 2
@ -771,6 +772,10 @@ case "$COMMAND" in
[ -n "$debugging" ] && set -x [ -n "$debugging" ] && set -x
case $2 in case $2 in
*.*.*.*-*.*.*.*) *.*.*.*-*.*.*.*)
for address in ${2%-*} ${2#*-}; do
valid_address $address || fatal_error "Invalid IP address: $address"
done
ip_range $2 ip_range $2
;; ;;
*) *)
@ -782,6 +787,7 @@ case "$COMMAND" in
[ -n "$debugging" ] && set -x [ -n "$debugging" ] && set -x
case $2 in case $2 in
*.*.*.*) *.*.*.*)
valid_address $2 || fatal_error "Invalid IP address: $2"
echo " $(decodeaddr $2)" echo " $(decodeaddr $2)"
;; ;;
*) *)