mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-25 17:13:11 +01:00
Avoid most /etc/shorewall/shorewall.conf verification for 'compile -e'
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@4122 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
716b99f198
commit
dffe6b47e7
@ -110,7 +110,7 @@
|
||||
# confirmation to accept or reject the new
|
||||
# configuration
|
||||
#
|
||||
# shorewall compile [ <directory> ] ]<filename>
|
||||
# shorewall compile [ -e ] [ <directory> ] <filename>
|
||||
# Compile a firewall program file.
|
||||
#
|
||||
# Fatal Error
|
||||
@ -192,29 +192,14 @@ validate_restorefile() # $* = label
|
||||
#
|
||||
get_config() {
|
||||
|
||||
if [ -z "$EXPORT" -a "$(whoami)" = root ]; then
|
||||
|
||||
[ -z "$LOGFILE" ] && LOGFILE=/var/log/messages
|
||||
|
||||
if [ ! -f $LOGFILE ]; then
|
||||
echo "LOGFILE ($LOGFILE) does not exist!" >&2
|
||||
exit 2
|
||||
fi
|
||||
#
|
||||
# See if we have a real version of "tail" -- use separate redirection so
|
||||
# that ash (aka /bin/sh on LRP) doesn't crap
|
||||
#
|
||||
if ( tail -n5 $LOGFILE > /dev/null 2> /dev/null ) ; then
|
||||
realtail="Yes"
|
||||
else
|
||||
realtail=""
|
||||
fi
|
||||
|
||||
[ -n "$FW" ] || FW=fw
|
||||
|
||||
[ -n "LOGFORMAT" ] && LOGFORMAT="${LOGFORMAT%%%*}"
|
||||
|
||||
[ -n "$LOGFORMAT" ] || LOGFORMAT="Shorewall:"
|
||||
|
||||
export LOGFORMAT
|
||||
|
||||
if [ -n "$IPTABLES" ]; then
|
||||
if [ ! -e "$IPTABLES" ]; then
|
||||
@ -231,11 +216,14 @@ get_config() {
|
||||
|
||||
export IPTABLES
|
||||
|
||||
if [ -n "$SHOREWALL_SHELL" ]; then
|
||||
if [ ! -e "$SHOREWALL_SHELL" ]; then
|
||||
echo " ERROR: The program specified in SHOREWALL_SHELL does not exist or is not executable" >&2
|
||||
exit 2
|
||||
fi
|
||||
#
|
||||
# See if we have a real version of "tail" -- use separate redirection so
|
||||
# that ash (aka /bin/sh on LRP) doesn't crap
|
||||
#
|
||||
if ( tail -n5 $LOGFILE > /dev/null 2> /dev/null ) ; then
|
||||
realtail="Yes"
|
||||
else
|
||||
realtail=""
|
||||
fi
|
||||
|
||||
[ -n "$RESTOREFILE" ] || RESTOREFILE=restore
|
||||
@ -245,11 +233,11 @@ get_config() {
|
||||
export RESTOREFILE
|
||||
|
||||
case $STARTUP_ENABLED in
|
||||
[Nn][Oo])
|
||||
No|no|NO)
|
||||
echo " WARNING: Shorewall startup is disabled. To enable startup, set STARTUP_ENABLED=Yes in ${CONFDIR}/shorewall.conf" >&2
|
||||
STARTUP_ENABLED=
|
||||
;;
|
||||
[Yy][Ee][Ss])
|
||||
Yes|yes|YES)
|
||||
;;
|
||||
*)
|
||||
if [ -n "$STARTUP_ENABLED" ]; then
|
||||
@ -260,11 +248,26 @@ get_config() {
|
||||
esac
|
||||
|
||||
case ${TC_ENABLED:=Internal} in
|
||||
[Nn][Oo])
|
||||
No|NO|no)
|
||||
TC_ENABLED=
|
||||
;;
|
||||
esac
|
||||
|
||||
fi
|
||||
|
||||
[ -n "LOGFORMAT" ] && LOGFORMAT="${LOGFORMAT%%%*}"
|
||||
|
||||
[ -n "$LOGFORMAT" ] || LOGFORMAT="Shorewall:"
|
||||
|
||||
export LOGFORMAT
|
||||
|
||||
if [ -n "$SHOREWALL_SHELL" ]; then
|
||||
if [ ! -e "$SHOREWALL_SHELL" ]; then
|
||||
echo " ERROR: The program specified in SHOREWALL_SHELL does not exist or is not executable" >&2
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
[ -n "${VERBOSITY:=2}" ]
|
||||
|
||||
VERBOSE=$(($VERBOSE_OFFSET + $VERBOSITY))
|
||||
|
Loading…
Reference in New Issue
Block a user