mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-01 20:13:49 +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
|
# confirmation to accept or reject the new
|
||||||
# configuration
|
# configuration
|
||||||
#
|
#
|
||||||
# shorewall compile [ <directory> ] ]<filename>
|
# shorewall compile [ -e ] [ <directory> ] <filename>
|
||||||
# Compile a firewall program file.
|
# Compile a firewall program file.
|
||||||
#
|
#
|
||||||
# Fatal Error
|
# Fatal Error
|
||||||
@ -192,29 +192,14 @@ validate_restorefile() # $* = label
|
|||||||
#
|
#
|
||||||
get_config() {
|
get_config() {
|
||||||
|
|
||||||
|
if [ -z "$EXPORT" -a "$(whoami)" = root ]; then
|
||||||
|
|
||||||
[ -z "$LOGFILE" ] && LOGFILE=/var/log/messages
|
[ -z "$LOGFILE" ] && LOGFILE=/var/log/messages
|
||||||
|
|
||||||
if [ ! -f $LOGFILE ]; then
|
if [ ! -f $LOGFILE ]; then
|
||||||
echo "LOGFILE ($LOGFILE) does not exist!" >&2
|
echo "LOGFILE ($LOGFILE) does not exist!" >&2
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
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 [ -n "$IPTABLES" ]; then
|
||||||
if [ ! -e "$IPTABLES" ]; then
|
if [ ! -e "$IPTABLES" ]; then
|
||||||
@ -231,11 +216,14 @@ get_config() {
|
|||||||
|
|
||||||
export IPTABLES
|
export IPTABLES
|
||||||
|
|
||||||
if [ -n "$SHOREWALL_SHELL" ]; then
|
#
|
||||||
if [ ! -e "$SHOREWALL_SHELL" ]; then
|
# See if we have a real version of "tail" -- use separate redirection so
|
||||||
echo " ERROR: The program specified in SHOREWALL_SHELL does not exist or is not executable" >&2
|
# that ash (aka /bin/sh on LRP) doesn't crap
|
||||||
exit 2
|
#
|
||||||
fi
|
if ( tail -n5 $LOGFILE > /dev/null 2> /dev/null ) ; then
|
||||||
|
realtail="Yes"
|
||||||
|
else
|
||||||
|
realtail=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -n "$RESTOREFILE" ] || RESTOREFILE=restore
|
[ -n "$RESTOREFILE" ] || RESTOREFILE=restore
|
||||||
@ -245,11 +233,11 @@ get_config() {
|
|||||||
export RESTOREFILE
|
export RESTOREFILE
|
||||||
|
|
||||||
case $STARTUP_ENABLED in
|
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
|
echo " WARNING: Shorewall startup is disabled. To enable startup, set STARTUP_ENABLED=Yes in ${CONFDIR}/shorewall.conf" >&2
|
||||||
STARTUP_ENABLED=
|
STARTUP_ENABLED=
|
||||||
;;
|
;;
|
||||||
[Yy][Ee][Ss])
|
Yes|yes|YES)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if [ -n "$STARTUP_ENABLED" ]; then
|
if [ -n "$STARTUP_ENABLED" ]; then
|
||||||
@ -260,11 +248,26 @@ get_config() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
case ${TC_ENABLED:=Internal} in
|
case ${TC_ENABLED:=Internal} in
|
||||||
[Nn][Oo])
|
No|NO|no)
|
||||||
TC_ENABLED=
|
TC_ENABLED=
|
||||||
;;
|
;;
|
||||||
esac
|
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}" ]
|
[ -n "${VERBOSITY:=2}" ]
|
||||||
|
|
||||||
VERBOSE=$(($VERBOSE_OFFSET + $VERBOSITY))
|
VERBOSE=$(($VERBOSE_OFFSET + $VERBOSITY))
|
||||||
|
Loading…
Reference in New Issue
Block a user