forked from YunoHost/yunohost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyunohost-firewall.init
53 lines (47 loc) · 1.34 KB
/
yunohost-firewall.init
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
#! /bin/bash
### BEGIN INIT INFO
# Provides: yunohost-firewall
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop YunoHost firewall
# Description: Start/stop YunoHost firewall
### END INIT INFO
DAEMON=/usr/bin/yunohost
DAEMON_OPTS=""
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
logger "YunoHost firewall: Start script executed"
case "$1" in
start)
logger "YunoHost firewall: Starting"
log_daemon_msg "Starting firewall: YunoHost"
/usr/bin/yunohost firewall reload
log_end_msg $?
;;
stop)
logger "YunoHost firewall: Stopping"
log_daemon_msg "Stopping firewall: YunoHost"
/usr/bin/yunohost firewall stop
log_end_msg $?
;;
restart|force-reload)
logger "YunoHost firewall: Restarting"
log_daemon_msg "Restarting firewall: YunoHost"
/usr/bin/yunohost firewall reload
log_end_msg $?
;;
status)
logger "YunoHost API: Running"
log_daemon_msg "YunoHost API: Running"
iptables -L | grep "Chain INPUT (policy DROP)" > /dev/null 2>&1
log_end_msg $?
;;
*)
logger "YunoHost API: Invalid usage"
echo "Usage: /etc/init.d/yunohost-api {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac
exit 0