"Fossies" - the Fresh Open Source Software Archive

Member "shorewall6-lite-5.2.8/init.sh" (24 Sep 2020, 2871 Bytes) of package /linux/misc/shorewall/shorewall6-lite-5.2.8.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "init.sh": 5.2.3.6_vs_5.2.6.

    1 #!/bin/sh
    2 RCDLINKS="2,S41 3,S41 6,K41"
    3 #
    4 #     The Shoreline Firewall (Shorewall) Packet Filtering Firewall - V5.2
    5 #
    6 #     (c) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2012,2014 - Tom Eastep (teastep@shorewall.net)
    7 #
    8 #   On most distributions, this file should be called /etc/init.d/shorewall.
    9 #
   10 #   Complete documentation is available at https://shorewall.org
   11 #
   12 #       This program is part of Shorewall.
   13 #
   14 #   This program is free software; you can redistribute it and/or modify
   15 #   it under the terms of the GNU General Public License as published by the
   16 #       Free Software Foundation, either version 2 of the license or, at your
   17 #       option, any later version.
   18 #
   19 #   This program is distributed in the hope that it will be useful,
   20 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
   21 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   22 #   GNU General Public License for more details.
   23 #
   24 #   You should have received a copy of the GNU General Public License
   25 #   along with this program; if not, see <http://www.gnu.org/licenses/>.
   26 #
   27 #   If an error occurs while starting or restarting the firewall, the
   28 #   firewall is automatically stopped.
   29 #
   30 #   Commands are:
   31 #
   32 #      shorewall6-lite start              Starts the firewall
   33 #      shorewall6-lite restart            Restarts the firewall
   34 #      shorewall6-lite reload             Reload the firewall
   35 #                                 (same as restart)
   36 #      shorewall6-lite stop               Stops the firewall
   37 #      shorewall6-lite status             Displays firewall status
   38 #
   39 
   40 # chkconfig: 2345 25 90
   41 # description: Packet filtering firewall
   42 
   43 ### BEGIN INIT INFO
   44 # Provides:   shorewall6-lite
   45 # Required-Start: $network
   46 # Required-Stop:
   47 # Default-Start:  2 3 5
   48 # Default-Stop:   0 1 6
   49 # Description:    starts and stops the shorewall firewall
   50 ### END INIT INFO
   51 
   52 ################################################################################
   53 # Give Usage Information                               #
   54 ################################################################################
   55 usage() {
   56     echo "Usage: $0 start|stop|reload|restart|status"
   57     exit 1
   58 }
   59 
   60 ################################################################################
   61 # Get startup options (override default)
   62 ################################################################################
   63 OPTIONS=
   64 
   65 #
   66 # The installer may alter this
   67 #
   68 . /usr/share/shorewall/shorewallrc
   69 
   70 export SHOREWALL_INIT_SCRIPT=1
   71 
   72 ################################################################################
   73 # E X E C U T I O N    B E G I N S   H E R E                       #
   74 ################################################################################
   75 command="$1"
   76 
   77 case "$command" in
   78     start)
   79     exec ${SBINDIR}/shorewall -6l $OPTIONS start $STARTOPTIONS
   80     ;;
   81     restart|reload)
   82     exec ${SBINDIR}/shorewall -6l $OPTIONS restart $RESTARTOPTIONS
   83     ;;
   84     status|stop)
   85     exec ${SBINDIR}/shorewall -6l $OPTIONS $command $@
   86     ;;
   87     *)
   88     usage
   89     ;;
   90 esac