From dad45a396f59ffffca32d1c2da079e54a1957b66 Mon Sep 17 00:00:00 2001 From: teastep Date: Mon, 11 Nov 2002 16:46:50 +0000 Subject: [PATCH] Adopt some ideas from autoconf regarding shell portability git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@329 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall/shorewall | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Shorewall/shorewall b/Shorewall/shorewall index 775623c0b..1a7253cb6 100755 --- a/Shorewall/shorewall +++ b/Shorewall/shorewall @@ -315,15 +315,6 @@ monitor_firewall() # $1 = timeout -- if negative, prompt each time that qt which awk && { haveawk=Yes; determine_zones; } || haveawk= - case `echo -e` in - -e*) - ring_bell="echo \'\a\'" - ;; - *) - ring_bell="echo -e \'\a\'" - ;; - esac - while true; do display_chains @@ -341,13 +332,13 @@ monitor_firewall() # $1 = timeout -- if negative, prompt each time that if [ "$rejects" != "$oldrejects" ]; then oldrejects="$rejects" - $ring_bell + $RING_BELL packet_log 20 if [ "$pause" = "Yes" ]; then echo - echo -n 'Enter any character to continue: ' + echo $ECHO_N 'Enter any character to continue: ' read foo else timed_read @@ -416,15 +407,6 @@ logwatch() # $1 = timeout -- if negative, prompt each time that qt which awk && haveawk=Yes || haveawk= - case `echo -e` in - -e*) - ring_bell="echo \'\a\'" - ;; - *) - ring_bell="echo -e \'\a\'" - ;; - esac - while true; do clear echo "$banner `date`" @@ -440,13 +422,13 @@ logwatch() # $1 = timeout -- if negative, prompt each time that if [ "$rejects" != "$oldrejects" ]; then oldrejects="$rejects" - $ring_bell + $RING_BELL packet_log 40 if [ "$pause" = "Yes" ]; then echo - echo -n 'Enter any character to continue: ' + echo $ECHO_N 'Enter any character to continue: ' read foo else timed_read @@ -587,6 +569,24 @@ banner="Shorewall-$version Status at $HOSTNAME -" get_statedir +case `echo -e` in + -e*) + RING_BELL="echo \'\a\'" + ;; + *) + RING_BELL="echo -e \'\a\'" + ;; +esac + +case `echo -n "Testing"` in + -n*) + ECHO_N= + ;; + *) + ECHO_N=-n + ;; +esac + case "$1" in start|stop|restart|reset|clear|refresh|check) [ $# -ne 1 ] && usage 1