Change -t option to -r

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@9333 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2009-01-24 17:04:06 +00:00
parent 4dc66ad225
commit d737ee0896
2 changed files with 20 additions and 20 deletions

View File

@ -2,7 +2,7 @@
# Give Usage Information # Give Usage Information
# #
usage() { usage() {
echo "Usage: $0 [ -q ] [ -v ] [ -n ] [ start|stop|clear|reset|refresh|restart|status|version ]" echo "Usage: $0 [ -q ] [ -v ] [ -n ] [ -r ] [ start|stop|clear|reset|refresh|restart|status|version ]"
exit $1 exit $1
} }
################################################################################ ################################################################################
@ -45,19 +45,19 @@ while [ $finished -eq 0 -a $# -gt 0 ]; do
VERBOSE=$(($VERBOSE - 1 )) VERBOSE=$(($VERBOSE - 1 ))
option=${option#q} option=${option#q}
;; ;;
t) r*)
if [ -n "$NOTCR" ]; then if [ -n "$NOTCR" ]; then
error_message "The 'n' and 't' options are mutually exclusive" error_message "The -n and -r options are mutually exclusive"
exit 1 exit 1
fi fi
TCRONLY=Yes TCRONLY=Yes
option=${option#t} option=${option#r}
PRODUCT="$PRODUCT Traffic Control and Routing" PRODUCT="$PRODUCT Traffic Control and Routing"
;; ;;
n*) n*)
if [ -n "$TCRONLY" ]; then if [ -n "$TCRONLY" ]; then
error_message "The 'n' and 't' options are mutually exclusive" error_message "The -n and -r options are mutually exclusive"
exit 1 exit 1
fi fi
@ -112,7 +112,7 @@ case "$COMMAND" in
;; ;;
reset) reset)
if [ -n "${NOTCR}$"{TCRONLY} ]; then if [ -n "${NOTCR}$"{TCRONLY} ]; then
error_message "The -n and -t options may not be used with 'reset'" error_message "The -n and -r options may not be used with 'reset'"
status=1 status=1
elif ! shorewall_is_started ; then elif ! shorewall_is_started ; then
error_message "$PRODUCT is not running" error_message "$PRODUCT is not running"
@ -161,7 +161,7 @@ case "$COMMAND" in
refresh) refresh)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
if [ -n "${NOTCR}$"{TCRONLY} ]; then if [ -n "${NOTCR}$"{TCRONLY} ]; then
error_message "The -n and -t options may not be used with 'refresh'" error_message "The -n and -r options may not be used with 'refresh'"
status=1 status=1
elif shorewall_is_started; then elif shorewall_is_started; then
progress_message3 "Refreshing $PRODUCT...." progress_message3 "Refreshing $PRODUCT...."
@ -176,7 +176,7 @@ case "$COMMAND" in
restore) restore)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
if [ -n "${NOTCR}$"{TCRONLY} ]; then if [ -n "${NOTCR}$"{TCRONLY} ]; then
error_message "The -n and -t options may not be used with 'restart'" error_message "The -n and -r options may not be used with 'restart'"
status=1 status=1
else else
define_firewall define_firewall
@ -189,7 +189,7 @@ case "$COMMAND" in
clear) clear)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
if [ -n "${NOTCR}$"{TCRONLY} ]; then if [ -n "${NOTCR}$"{TCRONLY} ]; then
error_message "The -n and -t options may not be used with 'clear'" error_message "The -n and -r options may not be used with 'clear'"
status=1 status=1
else else
progress_message3 "Clearing $PRODUCT...." progress_message3 "Clearing $PRODUCT...."

View File

@ -2,7 +2,7 @@
# Give Usage Information # Give Usage Information
# #
usage() { usage() {
echo "Usage: $0 [ -q ] [ -v ] [ -n ] [ -t ] [ start|stop|clear|reset|refresh|restart|status|version ]" echo "Usage: $0 [ -q ] [ -v ] [ -n ] [ -r ] [ start|stop|clear|reset|refresh|restart|status|version ]"
exit $1 exit $1
} }
################################################################################ ################################################################################
@ -23,6 +23,8 @@ fi
initialize initialize
[ -n "${PRODUCT:=Shorewall6}" ]
finished=0 finished=0
while [ $finished -eq 0 -a $# -gt 0 ]; do while [ $finished -eq 0 -a $# -gt 0 ]; do
@ -43,19 +45,19 @@ while [ $finished -eq 0 -a $# -gt 0 ]; do
VERBOSE=$(($VERBOSE - 1 )) VERBOSE=$(($VERBOSE - 1 ))
option=${option#q} option=${option#q}
;; ;;
t) r*)
if [ -n "$NOTCR" ]; then if [ -n "$NOTCR" ]; then
error_message "The -n and -t options are mutually exclusive" error_message "The -n and -r options are mutually exclusive"
exit 1 exit 1
fi fi
TCRONLY=Yes TCRONLY=Yes
option=${option#t} option=${option#r}
PRODUCT="$PRODUCT Traffic Control and Routing" PRODUCT="$PRODUCT Traffic Control and Routing"
;; ;;
n*) n*)
if [ -n "$TCRONLY" ]; then if [ -n "$TCRONLY" ]; then
error_message "The -n and -t options are mutually exclusive" error_message "The -n and -r options are mutually exclusive"
exit 1 exit 1
fi fi
@ -77,8 +79,6 @@ done
COMMAND="$1" COMMAND="$1"
[ -n "${PRODUCT:=Shorewall6}" ]
kernel=$(printf "%2d%02d%02d\n" $(echo $(uname -r) 2> /dev/null | sed 's/-.*//' | tr '.' ' ' ) | head -n1) kernel=$(printf "%2d%02d%02d\n" $(echo $(uname -r) 2> /dev/null | sed 's/-.*//' | tr '.' ' ' ) | head -n1)
if [ $kernel -lt 20625 ]; then if [ $kernel -lt 20625 ]; then
error_message "ERROR: $PRODUCT requires Linux kernel 2.6.25 or later" error_message "ERROR: $PRODUCT requires Linux kernel 2.6.25 or later"
@ -117,7 +117,7 @@ else
;; ;;
reset) reset)
if [ -n "${NOTCR}$"{TCRONLY} ]; then if [ -n "${NOTCR}$"{TCRONLY} ]; then
error_message "The -n and -t options may not be used with 'reset'" error_message "The -n and -r options may not be used with 'reset'"
status=1 status=1
elif ! shorewall6_is_started ; then elif ! shorewall6_is_started ; then
error_message "$PRODUCT is not running" error_message "$PRODUCT is not running"
@ -172,7 +172,7 @@ else
refresh) refresh)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
if [ -n "${NOTCR}$"{TCRONLY} ]; then if [ -n "${NOTCR}$"{TCRONLY} ]; then
error_message "The -n and -t options may not be used with 'refresh'" error_message "The -n and -r options may not be used with 'refresh'"
status=1 status=1
elif shorewall6_is_started; then elif shorewall6_is_started; then
progress_message3 "Refreshing $PRODUCT...." progress_message3 "Refreshing $PRODUCT...."
@ -187,7 +187,7 @@ else
restore) restore)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
if [ -n "${NOTCR}$"{TCRONLY} ]; then if [ -n "${NOTCR}$"{TCRONLY} ]; then
error_message "The -n and -t options may not be used with 'restore'" error_message "The -n and -r options may not be used with 'restore'"
status=1 status=1
else else
define_firewall define_firewall
@ -200,7 +200,7 @@ else
clear) clear)
[ $# -ne 1 ] && usage 2 [ $# -ne 1 ] && usage 2
if [ -n "${NOTCR}$"{TCRONLY} ]; then if [ -n "${NOTCR}$"{TCRONLY} ]; then
error_message "The -n and -t options may not be used with 'restore'" error_message "The -n and -r options may not be used with 'clear'"
status=1 status=1
else else
progress_message3 "Clearing $PRODUCT...." progress_message3 "Clearing $PRODUCT...."