Revert "Ignore 'start' and 'stop' if firewall(s) is started"

This reverts commit b6f5b6ba98.
This commit is contained in:
Tom Eastep 2020-04-16 13:32:03 -07:00
parent 4e1262ec7e
commit caa0290cb2

View File

@ -24,20 +24,6 @@
# along with this program; if not, see <http://www.gnu.org/licenses/>. # along with this program; if not, see <http://www.gnu.org/licenses/>.
# #
############################################################################### ###############################################################################
#
# Check to see if any of the products are running. If so, issue a warning
# and exits with value 1
firewall_stopped() {
for product in $PRODUCTS; do
if $product status > /dev/null 2>&1; then
echo " WARNING: $product is running -- ignoring $1 command" >&2
return 1
fi
done
return 0
}
# set the STATEDIR variable # set the STATEDIR variable
setstatedir() { setstatedir() {
local statedir local statedir
@ -56,6 +42,23 @@ setstatedir() {
fi fi
} }
#
# This is modified by the installer when ${SHAREDIR} <> /usr/share
#
. /usr/share/shorewall/shorewallrc
# check if shorewall-init is configured or not
if [ -f "$SYSCONFDIR/shorewall-init" ]; then
. $SYSCONFDIR/shorewall-init
if [ -z "$PRODUCTS" ]; then
echo "ERROR: No products configured" >&2
exit 1
fi
else
echo "ERROR: ${SYSCONFDIR}/shorewall-init not found" >&2
exit 1
fi
# Initialize the firewall # Initialize the firewall
shorewall_start () { shorewall_start () {
local PRODUCT local PRODUCT
@ -106,29 +109,12 @@ shorewall_stop () {
return 0 return 0
} }
#
# This is modified by the installer when ${SHAREDIR} <> /usr/share
#
. /usr/share/shorewall/shorewallrc
# check if shorewall-init is configured or not
if [ -f "$SYSCONFDIR/shorewall-init" ]; then
. $SYSCONFDIR/shorewall-init
if [ -z "$PRODUCTS" ]; then
echo "ERROR: No products configured" >&2
exit 1
fi
else
echo "ERROR: ${SYSCONFDIR}/shorewall-init not found" >&2
exit 1
fi
case "$1" in case "$1" in
start) start)
firewall_stopped 'start' && shorewall_start shorewall_start
;; ;;
stop) stop)
firewall_stopped 'stop' && shorewall_stop shorewall_stop
;; ;;
*) *)
echo "Usage: $0 {start|stop}" echo "Usage: $0 {start|stop}"