File: firewall

package info (click to toggle)
mason 1.0.0-13
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 2,300 kB
  • sloc: sh: 4,158; makefile: 104
file content (87 lines) | stat: -rwxr-xr-x 1,858 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/sh
#
# firewall        Starts a Mason firewall.
#
#
### BEGIN INIT INFO
# Provides:          mason
# Required-Start:    $network
# Required-Stop:     $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Starts the mason firewall script
# Description:       Starts the firewall script /etc/mason.baserules. The script was created with the mason firewall builder.
### END INIT INFO
#
# chkconfig: 2345 18 92
# description: firewall starts the firewall created by the Mason \
# firewall builder.  As a firewall is important to system security, \
# it should be always turned on.

# Debian init script derived from original script by Jeff Licquia

# Debian flags for runlevels - similar to RH's chkconfig.
FLAGS="defaults 19"

# Source function library.
if [ -f /etc/rc.d/init.d/functions ]; then
	. /etc/rc.d/init.d/functions
fi

MASONCONF=${MASONCONF:-"/etc/masonrc"}
[ -f $MASONCONF ] || exit 0

MASONDIR=${MASONDIR:-"/var/lib/mason/"}
MASONLIB=${MASONLIB:-"/var/lib/mason/masonlib"}
if [ -f $MASONLIB ]; then
	. $MASONLIB
else
	echo Missing $MASONLIB library file.  Please get a complete copy of Mason from >/dev/stderr
	echo http://www.pobox.com/~wstearns/mason/ .  Exiting. >/dev/stderr
	exit
fi
if [ -f /etc/masonrc ]; then
	. /etc/masonrc
fi
checksys
checkconf


# See how we were called.
case "$1" in
  start)
	echo -n "Starting Mason firewall: "
	flushfirewall
	runfirewall STANDARD
	if [ -d /var/lock/subsys ]; then
		touch /var/lock/subsys/firewall
	fi
	echo
	;;
  stop)
	echo -n "Shutting down Mason firewall: "
	flushfirewall
	if [ -d /var/lock/subsys ]; then
		rm -f /var/lock/subsys/firewall
	fi
	echo
	;;
#  status)
#	status syslogd
#	status klogd
#	;;
  restart)
	$0 stop
	$0 start
	;;
  force-reload)
	$0 stop
	$0 start
	;;
  *)
	echo "Usage: $0 {start|stop|restart|force-reload}"
	exit 1
esac

exit 0