Correct a number of issues with Shorewall-lite

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-04-04 07:08:02 -07:00
parent 24d30275fa
commit 38b6dca223
3 changed files with 8 additions and 10 deletions

View File

@ -859,7 +859,7 @@ show_command() {
echo "VARDIR=$VARDIR" echo "VARDIR=$VARDIR"
echo "LIBEXEC=$g_libexec" echo "LIBEXEC=$g_libexec"
echo "SBINDIR=$g_sbindir" echo "SBINDIR=$g_sbindir"
[ -n "$g_lite" ] && ${VARDIR} ne /var/lib/$program && echo "LITEDIR=${VARDIR}" [ -n "$g_lite" ] && [ ${VARDIR} != /var/lib/$g_program ] && echo "LITEDIR=${VARDIR}"
else else
echo "Default CONFIG_PATH is $CONFIG_PATH" echo "Default CONFIG_PATH is $CONFIG_PATH"
echo "Default VARDIR is /var/lib/$g_program" echo "Default VARDIR is /var/lib/$g_program"

View File

@ -33,7 +33,7 @@ g_program=shorewall-lite
. /usr/share/shorewall/shorewallrc . /usr/share/shorewall/shorewallrc
g_libexec="$LIBEXECDIR" g_libexec="$LIBEXECDIR"
g_sharedir="$SHAREDIR"/shoerwall-lite g_sharedir="$SHAREDIR"/shorewall-lite
g_sbindir="$SBINDIR" g_sbindir="$SBINDIR"
g_confdir="$CONFDIR"/shorewall-lite g_confdir="$CONFDIR"/shorewall-lite
g_readrc=1 g_readrc=1

View File

@ -1364,13 +1364,11 @@ reload_command() # $* = original arguments less the command.
;; ;;
esac esac
config=$(rsh_command ${g_program}-lite show config 2> /dev/null) temp=$(rsh_command ${g_program}-lite show config 2> /dev/null | grep ^LITEDIR | sed 's/LITEDIR is //')
temp=$(echo $config | grep ^LITEDIR | sed 's/LITEDIR is //')
[ -n "$temp" ] && litedir="$temp" [ -n "$temp" ] && litedir="$temp"
temp=$(echo $config | grep ^LIBEXEC | sed 's/LIBEXEC is //') temp=$(rsh_command ${g_program}-lite show config 2> /dev/null | grep ^LIBEXEC | sed 's/LIBEXEC is //')
if [ -n "$temp" ]; then if [ -n "$temp" ]; then
case $temp in case $temp in
@ -1383,7 +1381,7 @@ reload_command() # $* = original arguments less the command.
esac esac
fi fi
temp=$(echo $config | grep ^SBINDIR | sed 's/SBINDIR is //') temp=$(rsh_command ${g_program}-lite show config 2> /dev/null | grep ^SBINDIR | sed 's/SBINDIR is //')
if [ -n "$temp" ]; then if [ -n "$temp" ]; then
sbindir="$temp" sbindir="$temp"
@ -1435,15 +1433,15 @@ reload_command() # $* = original arguments less the command.
progress_message3 "Copy complete" progress_message3 "Copy complete"
if [ $COMMAND = reload ]; then if [ $COMMAND = reload ]; then
rsh_command "${sbin}/${g_program}-lite $g_debugging $verbose $timestamp restart" && \ rsh_command "${sbindir}/${g_program}-lite $g_debugging $verbose $timestamp restart" && \
progress_message3 "System $system reloaded" || saveit= progress_message3 "System $system reloaded" || saveit=
else else
rsh_command "${sbin}/${g_program}-lite $g_debugging $verbose $timestamp start" && \ rsh_command "${sbindir}/${g_program}-lite $g_debugging $verbose $timestamp start" && \
progress_message3 "System $system loaded" || saveit= progress_message3 "System $system loaded" || saveit=
fi fi
if [ -n "$saveit" ]; then if [ -n "$saveit" ]; then
rsh_command "${sbin}/${g_program}-lite $g_debugging $verbose $timestamp save" && \ rsh_command "${sbindir}/${g_program}-lite $g_debugging $verbose $timestamp save" && \
progress_message3 "Configuration on system $system saved" progress_message3 "Configuration on system $system saved"
fi fi
fi fi