5e01d1e0cb3eafd152cede934a54c4414a60dc3e
[pve-firewall.git] / debian / pve-firewall.init
1 #!/bin/sh
2
3 ### BEGIN INIT INFO
4 # Provides: pve-firewall
5 # Required-Start: $remote_fs $network pvefw-logger pve-cluster
6 # Required-Stop: $remote_fs $network pvefw-logger pve-cluster
7 # Default-Start: 2 3 4 5
8 # Default-Stop: 0 1 6
9 # Short-Description: PVE firewall
10 ### END INIT INFO
11
12 . /lib/lsb/init-functions
13
14 PATH=/sbin:/bin:/usr/bin:/usr/sbin
15 PVEFW=/usr/sbin/pvefw
16 NAME=pvefw
17 DESC="PVE firewall"
18 PIDFILE=/var/run/pvefw-logger.pid
19
20 test -f $PVEFW || exit 0
21
22 # avoid warnings about uninstalled locales
23 export LC_ALL="C"
24
25 case "$1" in
26 start)
27 log_daemon_msg "Starting $DESC" "$NAME"
28 $PVEFW start
29 log_end_msg $?
30 ;;
31 stop)
32 log_daemon_msg "Stopping $DESC" "$NAME"
33 $PVEFW stop
34 log_end_msg $?
35 ;;
36 reload|restart|force-reload)
37 log_daemon_msg "Restarting $DESC" "$NAME"
38 $PVEFW update
39 log_end_msg $?
40 ;;
41 *)
42 N=/etc/init.d/$NAME
43 echo "Usage: $N {start|stop|restart|force-reload}"
44 exit 1
45 ;;
46 esac
47
48 exit 0