summaryrefslogtreecommitdiff
blob: 8b9f0579f223bc1831dda97c3bb8061c4b65fb3f (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
#!/sbin/openrc-run
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

command="/usr/sbin/miniupnpd"
: "${config_file:=/etc/miniupnpd/miniupnpd.conf}"
command_args="-f ${config_file:-/etc/miniupnpd/miniupnpd.conf} ${extra_args}"
: "${pidfile:=/var/run/miniupnpd.pid}"

depend() {
	need net
	use iptables minissdpd
}

start_pre() {
	local retval=0

	if [ -n "${iptables_scripts}" ]; then
		/etc/miniupnpd/iptables_init.sh || retval=${?}
	fi
	
	return ${retval}
}

stop_post() {
	local retval=0

	if [ -n "${iptables_scripts}" ]; then
		/etc/miniupnpd/iptables_removeall.sh
	fi

	return ${retval}
}