More global variable renaming

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-02-23 07:52:35 -08:00
parent 570497766b
commit bffb1793d7
4 changed files with 42 additions and 44 deletions

View File

@ -245,13 +245,13 @@ logwatch() # $1 = timeout -- if negative, prompt each time that
if [ "$rejects" != "$oldrejects" ]; then if [ "$rejects" != "$oldrejects" ]; then
oldrejects="$rejects" oldrejects="$rejects"
$RING_BELL $g_ring_bell
packet_log 40 packet_log 40
if [ "$pause" = "Yes" ]; then if [ "$pause" = "Yes" ]; then
echo echo
echo $ECHO_N 'Enter any character to continue: ' echo $g_echo_n 'Enter any character to continue: '
read foo read foo
else else
timed_read timed_read
@ -440,7 +440,7 @@ show_command() {
if [ ${#macro} -gt 10 ]; then if [ ${#macro} -gt 10 ]; then
echo " $macro ${foo#\#}" echo " $macro ${foo#\#}"
else else
$ECHO_E " $macro \t${foo#\#}" $g_echo_e " $macro \t${foo#\#}"
fi fi
fi fi
} }

View File

@ -1584,6 +1584,7 @@ MUTEX_TIMEOUT=
SHAREDIR=/usr/share/shorewall SHAREDIR=/usr/share/shorewall
CONFDIR=/etc/shorewall CONFDIR=/etc/shorewall
export PRODUCT="Shorewall" export PRODUCT="Shorewall"
export RECOVERING=
[ -f ${CONFDIR}/vardir ] && . ${CONFDIR}/vardir [ -f ${CONFDIR}/vardir ] && . ${CONFDIR}/vardir
@ -1593,13 +1594,10 @@ if [ ! -f ${VARDIR}/firewall ]; then
[ -f ${VARDIR}/.restore ] && cp -f ${VARDIR}/.restore ${VARDIR}/firewall [ -f ${VARDIR}/.restore ] && cp -f ${VARDIR}/.restore ${VARDIR}/firewall
fi fi
FIREWALL=${VARDIR}/firewall g_firewall=${VARDIR}/firewall
LIBRARIES="$SHAREDIR/lib.base $SHAREDIR/lib.cli"
VERSION_FILE=$SHAREDIR/version
RECOVERING=
export RECOVERING
for library in $LIBRARIES; do libraries="$SHAREDIR/lib.base $SHAREDIR/lib.cli"
for library in $libraries; do
if [ -f $library ]; then if [ -f $library ]; then
. $library . $library
else else
@ -1608,11 +1606,12 @@ for library in $LIBRARIES; do
fi fi
done done
if [ -f $VERSION_FILE ]; then version_file=$SHAREDIR/version
version=$(cat $VERSION_FILE) if [ -f $version_file ]; then
version=$(cat $version_file)
else else
echo " ERROR: Shorewall is not properly installed" >&2 echo " ERROR: Shorewall is not properly installed" >&2
echo " The file $VERSION_FILE does not exist" >&2 echo " The file $version_file does not exist" >&2
exit 1 exit 1
fi fi
@ -1620,21 +1619,21 @@ banner="Shorewall-$version Status at $HOSTNAME -"
case $(echo -e) in case $(echo -e) in
-e*) -e*)
RING_BELL="echo \a" g_ring_bell="echo \a"
ECHO_E="echo" g_echo_e="echo"
;; ;;
*) *)
RING_BELL="echo -e \a" g_ring_bell="echo -e \a"
ECHO_E="echo -e" g_echo_e="echo -e"
;; ;;
esac esac
case $(echo -n "Testing") in case $(echo -n "Testing") in
-n*) -n*)
ECHO_N= g_echo_n=
;; ;;
*) *)
ECHO_N=-n g_echo_n=-n
;; ;;
esac esac
@ -1649,10 +1648,10 @@ case "$COMMAND" in
stop|clear) stop|clear)
get_config get_config
[ $# -ne 1 ] && usage 1 [ $# -ne 1 ] && usage 1
[ -x $FIREWALL ] || fatal_error "Shorewall has never been started" [ -x $g_firewall ] || fatal_error "Shorewall has never been started"
export NOROUTES export NOROUTES
mutex_on mutex_on
$SHOREWALL_SHELL $FIREWALL $g_debugging $nolock $COMMAND $SHOREWALL_SHELL $g_firewall $g_debugging $nolock $COMMAND
mutex_off mutex_off
;; ;;
reset) reset)
@ -1660,8 +1659,8 @@ case "$COMMAND" in
export NOROUTES export NOROUTES
shift shift
mutex_on mutex_on
[ -x $FIREWALL ] || fatal_error "Shorewall has never been started" [ -x $g_firewall ] || fatal_error "Shorewall has never been started"
$SHOREWALL_SHELL $FIREWALL $g_debugging $nolock reset $@ $SHOREWALL_SHELL $g_firewall $g_debugging $nolock reset $@
mutex_off mutex_off
;; ;;
compile) compile)

View File

@ -226,13 +226,13 @@ logwatch() # $1 = timeout -- if negative, prompt each time that
if [ "$rejects" != "$oldrejects" ]; then if [ "$rejects" != "$oldrejects" ]; then
oldrejects="$rejects" oldrejects="$rejects"
$RING_BELL $g_ring_bell
packet_log 40 packet_log 40
if [ "$pause" = "Yes" ]; then if [ "$pause" = "Yes" ]; then
echo echo
echo $ECHO_N 'Enter any character to continue: ' echo $g_echo_n 'Enter any character to continue: '
read foo read foo
else else
timed_read timed_read
@ -353,7 +353,7 @@ show_command() {
if [ ${#macro} -gt 10 ]; then if [ ${#macro} -gt 10 ]; then
echo " $macro ${foo#\#}" echo " $macro ${foo#\#}"
else else
$ECHO_E " $macro \t${foo#\#}" $g_echo_e " $macro \t${foo#\#}"
fi fi
fi fi
} }

View File

@ -1497,6 +1497,7 @@ MUTEX_TIMEOUT=
SHAREDIR=/usr/share/shorewall6 SHAREDIR=/usr/share/shorewall6
CONFDIR=/etc/shorewall6 CONFDIR=/etc/shorewall6
export PRODUCT="Shorewall6" export PRODUCT="Shorewall6"
export RECOVERING=
[ -f ${CONFDIR}/vardir ] && . ${CONFDIR}/vardir [ -f ${CONFDIR}/vardir ] && . ${CONFDIR}/vardir
@ -1506,13 +1507,10 @@ if [ ! -f ${VARDIR}/firewall ]; then
[ -f ${VARDIR}/.restore ] && cp -f ${VARDIR}/.restore ${VARDIR}/firewall [ -f ${VARDIR}/.restore ] && cp -f ${VARDIR}/.restore ${VARDIR}/firewall
fi fi
FIREWALL=${VARDIR}/firewall g_firewall=${VARDIR}/firewall
LIBRARIES="$SHAREDIR/lib.base $SHAREDIR/lib.cli"
VERSION_FILE=$SHAREDIR/version
RECOVERING=
export RECOVERING
for library in $LIBRARIES; do libraries="$SHAREDIR/lib.base $SHAREDIR/lib.cli"
for library in $libraries; do
if [ -f $library ]; then if [ -f $library ]; then
. $library . $library
else else
@ -1521,11 +1519,12 @@ for library in $LIBRARIES; do
fi fi
done done
if [ -f $VERSION_FILE ]; then version_file=$SHAREDIR/version
version=$(cat $VERSION_FILE) if [ -f $version_file ]; then
version=$(cat $version_file)
else else
echo " ERROR: Shorewall6 is not properly installed" >&2 echo " ERROR: Shorewall6 is not properly installed" >&2
echo " The file $VERSION_FILE does not exist" >&2 echo " The file $version_file does not exist" >&2
exit 1 exit 1
fi fi
@ -1533,21 +1532,21 @@ banner="Shorewall6-$version Status at $HOSTNAME -"
case $(echo -e) in case $(echo -e) in
-e*) -e*)
RING_BELL="echo \a" g_ring_bell="echo \a"
ECHO_E="echo" g_echo_e="echo"
;; ;;
*) *)
RING_BELL="echo -e \a" g_ring_bell="echo -e \a"
ECHO_E="echo -e" g_echo_e="echo -e"
;; ;;
esac esac
case $(echo -n "Testing") in case $(echo -n "Testing") in
-n*) -n*)
ECHO_N= g_echo_n=
;; ;;
*) *)
ECHO_N=-n g_echo_n=-n
;; ;;
esac esac
@ -1562,10 +1561,10 @@ case "$COMMAND" in
stop|clear) stop|clear)
[ $# -ne 1 ] && usage 1 [ $# -ne 1 ] && usage 1
get_config get_config
[ -x $FIREWALL ] || fatal_error "Shorewall6 has never been started" [ -x $g_firewall ] || fatal_error "Shorewall6 has never been started"
export NOROUTES export NOROUTES
mutex_on mutex_on
$SHOREWALL_SHELL $FIREWALL $g_debugging $nolock $COMMAND $SHOREWALL_SHELL $g_firewall $g_debugging $nolock $COMMAND
mutex_off mutex_off
;; ;;
reset) reset)
@ -1573,8 +1572,8 @@ case "$COMMAND" in
export NOROUTES export NOROUTES
shift shift
mutex_on mutex_on
[ -x $FIREWALL ] || fatal_error "Shorewall6 has never been started" [ -x $g_firewall ] || fatal_error "Shorewall6 has never been started"
$SHOREWALL_SHELL $FIREWALL $g_debugging $nolock reset $@ $SHOREWALL_SHELL $g_firewall $g_debugging $nolock reset $@
mutex_off mutex_off
;; ;;
compile) compile)