Fix for 'show macros' where /bin/sh is a light-weight shell

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5025 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2006-11-30 17:17:53 +00:00
parent 0ca8d0281c
commit 5924ab71b5
2 changed files with 29 additions and 8 deletions

View File

@ -361,6 +361,15 @@ show_routing() {
show_command() {
local finished=0 local table=filter
show_macro() {
foo=`grep 'This macro' $macro | sed 's/This macro //'`
if [ -n "$foo" ]; then
macro=${macro#*.}
foo=${foo%.*}
echo " $macro ${foo#\#}"
fi
}
while [ $finished -eq 0 -a $# -gt 0 ]; do
option=$1
case $option in
@ -529,13 +538,24 @@ show_command() {
;;
macros)
[ $# -gt 1 ] && usage 1
for macro in ${SHAREDIR}/macro.*; do
foo=`grep 'This macro' $macro | sed 's/This macro //'`
if [ -n "$foo" ]; then
macro=${macro#*.}
foo=${foo%.*}
echo " $macro ${foo#\#}"
fi
for directory in $(split $CONFIG_PATH); do
temp=
for macro in ${directory}/macro.*; do
case $macro in
*\*)
;;
*)
if [ -z "$temp" ]; then
echo
echo "Macros in $directory:"
echo
temp=Yes
fi
show_macro
;;
esac
done
done
return
;;

View File

@ -1209,7 +1209,8 @@ case "$COMMAND" in
fi
elif ! $IPTABLES -L shorewall > /dev/null 2> /dev/null; then
$0 $VERBOSE $NOROUTES start
elif [ $# -eq 3 ]; the sleep $3
elif [ $# -eq 3 ]; then
sleep $3
$0 $VERBOSE $NOROUTES restart
fi
;;