blob: bd8c3e32b9106993adb3d11ccf1981bcc516f301 (
plain)
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
|
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
[ -x /usr/bin/ufw ] || exit 0
for s in "/usr/lib/ufw/ufw-init-functions" "/etc/ufw/ufw.conf" ; do
if [ -s "$s" ]; then
. "$s"
else
echo "Could not find $s (aborting)"
exit 1
fi
done
error=0
case "$1" in
start)
if [ "$ENABLED" = "yes" ] || [ "$ENABLED" = "YES" ]; then
stat_busy "Starting ufw"
if ! ufw_start; then
stat_fail
else
add_daemon ufw
stat_done
fi
else
echo "Skip starting firewall:" "ufw (not enabled)"
fi
;;
stop)
if [ "$ENABLED" = "yes" ] || [ "$ENABLED" = "YES" ]; then
stat_busy "Stopping ufw"
if ! ufw_stop; then
stat_fail
else
rm_daemon ufw
stat_done
fi
else
echo "Skip stopping firewall:" "ufw (not enabled)"
fi
;;
restart|force-reload)
stat_busy "Reloading ufw"
if ! ufw_reload; then
stat_fail
else
stat_done
fi
;;
status)
ufw_status
;;
*)
echo "Usage: /etc/rc.d/ufw {start|stop|restart|force-reload|status}"
exit 1
;;
esac
exit 0
|