forked from extern/shorewall_code
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:
parent
4dc66ad225
commit
d737ee0896
@ -2,7 +2,7 @@
|
||||
# Give Usage Information
|
||||
#
|
||||
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
|
||||
}
|
||||
################################################################################
|
||||
@ -45,19 +45,19 @@ while [ $finished -eq 0 -a $# -gt 0 ]; do
|
||||
VERBOSE=$(($VERBOSE - 1 ))
|
||||
option=${option#q}
|
||||
;;
|
||||
t)
|
||||
r*)
|
||||
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
|
||||
fi
|
||||
|
||||
TCRONLY=Yes
|
||||
option=${option#t}
|
||||
option=${option#r}
|
||||
PRODUCT="$PRODUCT Traffic Control and Routing"
|
||||
;;
|
||||
n*)
|
||||
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
|
||||
fi
|
||||
|
||||
@ -112,7 +112,7 @@ case "$COMMAND" in
|
||||
;;
|
||||
reset)
|
||||
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
|
||||
elif ! shorewall_is_started ; then
|
||||
error_message "$PRODUCT is not running"
|
||||
@ -161,7 +161,7 @@ case "$COMMAND" in
|
||||
refresh)
|
||||
[ $# -ne 1 ] && usage 2
|
||||
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
|
||||
elif shorewall_is_started; then
|
||||
progress_message3 "Refreshing $PRODUCT...."
|
||||
@ -176,7 +176,7 @@ case "$COMMAND" in
|
||||
restore)
|
||||
[ $# -ne 1 ] && usage 2
|
||||
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
|
||||
else
|
||||
define_firewall
|
||||
@ -189,7 +189,7 @@ case "$COMMAND" in
|
||||
clear)
|
||||
[ $# -ne 1 ] && usage 2
|
||||
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
|
||||
else
|
||||
progress_message3 "Clearing $PRODUCT...."
|
||||
|
@ -2,7 +2,7 @@
|
||||
# Give Usage Information
|
||||
#
|
||||
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
|
||||
}
|
||||
################################################################################
|
||||
@ -23,6 +23,8 @@ fi
|
||||
|
||||
initialize
|
||||
|
||||
[ -n "${PRODUCT:=Shorewall6}" ]
|
||||
|
||||
finished=0
|
||||
|
||||
while [ $finished -eq 0 -a $# -gt 0 ]; do
|
||||
@ -43,19 +45,19 @@ while [ $finished -eq 0 -a $# -gt 0 ]; do
|
||||
VERBOSE=$(($VERBOSE - 1 ))
|
||||
option=${option#q}
|
||||
;;
|
||||
t)
|
||||
r*)
|
||||
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
|
||||
fi
|
||||
|
||||
TCRONLY=Yes
|
||||
option=${option#t}
|
||||
option=${option#r}
|
||||
PRODUCT="$PRODUCT Traffic Control and Routing"
|
||||
;;
|
||||
n*)
|
||||
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
|
||||
fi
|
||||
|
||||
@ -77,8 +79,6 @@ done
|
||||
|
||||
COMMAND="$1"
|
||||
|
||||
[ -n "${PRODUCT:=Shorewall6}" ]
|
||||
|
||||
kernel=$(printf "%2d%02d%02d\n" $(echo $(uname -r) 2> /dev/null | sed 's/-.*//' | tr '.' ' ' ) | head -n1)
|
||||
if [ $kernel -lt 20625 ]; then
|
||||
error_message "ERROR: $PRODUCT requires Linux kernel 2.6.25 or later"
|
||||
@ -117,7 +117,7 @@ else
|
||||
;;
|
||||
reset)
|
||||
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
|
||||
elif ! shorewall6_is_started ; then
|
||||
error_message "$PRODUCT is not running"
|
||||
@ -172,7 +172,7 @@ else
|
||||
refresh)
|
||||
[ $# -ne 1 ] && usage 2
|
||||
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
|
||||
elif shorewall6_is_started; then
|
||||
progress_message3 "Refreshing $PRODUCT...."
|
||||
@ -187,7 +187,7 @@ else
|
||||
restore)
|
||||
[ $# -ne 1 ] && usage 2
|
||||
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
|
||||
else
|
||||
define_firewall
|
||||
@ -200,7 +200,7 @@ else
|
||||
clear)
|
||||
[ $# -ne 1 ] && usage 2
|
||||
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
|
||||
else
|
||||
progress_message3 "Clearing $PRODUCT...."
|
||||
|
Loading…
Reference in New Issue
Block a user