2015-11-04 22:29:59 +01:00
|
|
|
#!/bin/sh /etc/rc.common
|
|
|
|
#
|
2018-06-23 17:29:01 +02:00
|
|
|
# The Shoreline Firewall (Shorewall) Packet Filtering Firewall - V5.2
|
2015-11-04 22:29:59 +01:00
|
|
|
#
|
|
|
|
# (c) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2012,2014 - Tom Eastep (teastep@shorewall.net)
|
|
|
|
# (c) 2015 - Matt Darfeuille - (matdarf@gmail.com)
|
|
|
|
#
|
|
|
|
# On most distributions, this file should be called /etc/init.d/shorewall.
|
|
|
|
#
|
|
|
|
# Complete documentation is available at http://shorewall.net
|
|
|
|
#
|
|
|
|
# This program is part of Shorewall.
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by the
|
|
|
|
# Free Software Foundation, either version 2 of the license or, at your
|
|
|
|
# option, any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
# If an error occurs while starting or restarting the firewall, the
|
|
|
|
# firewall is automatically stopped.
|
|
|
|
#
|
|
|
|
# Commands are:
|
|
|
|
#
|
|
|
|
# shorewall-lite start Starts the firewall
|
|
|
|
# shorewall-lite restart Restarts the firewall
|
|
|
|
# shorewall-lite reload Reload the firewall
|
|
|
|
# shorewall-lite stop Stops the firewall
|
|
|
|
# shorewall-lite status Displays firewall status
|
|
|
|
#
|
|
|
|
|
|
|
|
# description: Packet filtering firewall
|
|
|
|
|
2016-01-05 00:45:21 +01:00
|
|
|
# Openwrt related
|
2016-01-14 16:08:20 +01:00
|
|
|
# Start and stop runlevel variable
|
2016-01-05 00:45:21 +01:00
|
|
|
START=50
|
|
|
|
STOP=89
|
2016-01-14 16:08:20 +01:00
|
|
|
# Displays the status command
|
2015-11-04 22:29:59 +01:00
|
|
|
EXTRA_COMMANDS="status"
|
2016-01-14 16:08:20 +01:00
|
|
|
EXTRA_HELP=" status Displays firewall status"
|
2015-11-04 22:29:59 +01:00
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Get startup options (override default)
|
|
|
|
################################################################################
|
2016-01-05 00:45:21 +01:00
|
|
|
OPTIONS=
|
2015-11-04 22:29:59 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# The installer may alter this
|
|
|
|
#
|
|
|
|
. /usr/share/shorewall/shorewallrc
|
|
|
|
|
2016-01-14 16:08:20 +01:00
|
|
|
if [ -f ${SYSCONFDIR}/shorewall-lite ]; then
|
|
|
|
. ${SYSCONFDIR}/shorewall-lite
|
2015-11-04 22:29:59 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
SHOREWALL_INIT_SCRIPT=1
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# E X E C U T I O N B E G I N S H E R E #
|
|
|
|
################################################################################
|
2016-01-14 16:08:20 +01:00
|
|
|
# Arg1 of init script is arg2 when rc.common is sourced; set to action variable
|
2015-11-04 22:29:59 +01:00
|
|
|
command="$action"
|
|
|
|
|
|
|
|
start() {
|
2016-11-21 19:00:55 +01:00
|
|
|
exec ${SBINDIR}/shorewall -l $OPTIONS $command $STARTOPTIONS
|
2015-11-04 22:29:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
boot() {
|
2016-01-14 16:08:20 +01:00
|
|
|
local command="start"
|
|
|
|
start
|
2015-11-04 22:29:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
restart() {
|
2016-11-21 19:00:55 +01:00
|
|
|
exec ${SBINDIR}/shorewall -l $OPTIONS $command $RESTARTOPTIONS
|
2015-11-04 22:29:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
reload() {
|
2016-11-21 19:00:55 +01:00
|
|
|
exec ${SBINDIR}/shorewall -l $OPTIONS $command $RELOADOPTION
|
2015-11-04 22:29:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
2016-11-21 19:00:55 +01:00
|
|
|
exec ${SBINDIR}/shorewall -l $OPTIONS $command $STOPOPTIONS
|
2015-11-04 22:29:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
status() {
|
2016-11-21 19:00:55 +01:00
|
|
|
exec ${SBINDIR}/shorewall -l $OPTIONS $command $@
|
2015-11-04 22:29:59 +01:00
|
|
|
}
|