forked from extern/shorewall_code
Add startup_error() function to generated program
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@3369 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
657ec591f2
commit
21a4d1cebb
@ -1041,7 +1041,7 @@ ${INDENT}if [ -n "\$addr" ]; then
|
||||
${INDENT} addr=\$(echo \$addr | sed 's/inet //;s/\/.*//;s/ peer.*//')
|
||||
${INDENT} for network in 10.0.0.0/8 176.16.0.0/12 192.168.0.0/16; do
|
||||
${INDENT} if in_network \$addr \$network; then
|
||||
${INDENT} fatal_error "The 'norfc1918' option has been specified on an interface with an RFC 1918 address. Interface:$interface"
|
||||
${INDENT} startup_error "The 'norfc1918' option has been specified on an interface with an RFC 1918 address. Interface:$interface"
|
||||
${INDENT} fi
|
||||
${INDENT} done
|
||||
${INDENT}fi
|
||||
@ -8386,6 +8386,13 @@ fatal_error()
|
||||
exit 2
|
||||
}
|
||||
|
||||
startup_error() # $* = Error Message
|
||||
{
|
||||
echo " ERROR: \$@" >&2
|
||||
kill \$\$
|
||||
exit 2
|
||||
}
|
||||
|
||||
run_iptables()
|
||||
{
|
||||
if ! \$IPTABLES \$@; then
|
||||
@ -8417,8 +8424,7 @@ __EOF__
|
||||
if [ -z "$EXPORT" ]; then
|
||||
cat >> $RESTOREBASE << __EOF__
|
||||
if [ ! -f /usr/share/shorewall/version ] || [ \$(cat /usr/share/shorewall/version) != $VERSION ]; then
|
||||
error_message "ERROR: This script requires Shorewall version $VERSION"
|
||||
exit 2
|
||||
startup_error "This script requires Shorewall version $VERSION"
|
||||
fi
|
||||
|
||||
__EOF__
|
||||
@ -8428,8 +8434,8 @@ __EOF__
|
||||
#
|
||||
# These variables are required by the library functions called in this script
|
||||
#
|
||||
[ -n \${COMMAND:=restart} ]
|
||||
VERBOSE=\${VERBOSE:=0}
|
||||
[ -n "\${COMMAND:=restart}" ]
|
||||
[ -n "\${VERBOSE:=0}" ]
|
||||
MODULESDIR="$MODULESDIR"
|
||||
MODULE_SUFFIX="$MODULE_SUFFIX"
|
||||
LOGLIMIT="$LOGLIMIT"
|
||||
|
Loading…
Reference in New Issue
Block a user