Initial checkin
This commit is contained in:
40
linux/miniupnpd.init.d.script
Normal file
40
linux/miniupnpd.init.d.script
Normal file
@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
# $Id$
|
||||
# MiniUPnP project
|
||||
# author: Thomas Bernard
|
||||
# website: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
|
||||
|
||||
MINIUPNPD=/usr/sbin/miniupnpd
|
||||
ARGS='-f /etc/miniupnpd/miniupnpd.conf'
|
||||
|
||||
IPTABLES_CREATE=/etc/miniupnpd/iptables_init.sh
|
||||
IPTABLES_REMOVE=/etc/miniupnpd/iptables_removeall.sh
|
||||
|
||||
test -f $MINIUPNPD || exit 0
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
case "$1" in
|
||||
start) log_daemon_msg "Starting miniupnpd" "miniupnpd"
|
||||
$IPTABLES_CREATE > /dev/null 2>&1
|
||||
start-stop-daemon --start --quiet --pidfile /var/run/miniupnpd.pid --startas $MINIUPNPD -- $ARGS $LSBNAMES
|
||||
log_end_msg $?
|
||||
;;
|
||||
stop) log_daemon_msg "Stopping miniupnpd" "miniupnpd"
|
||||
start-stop-daemon --stop --quiet --pidfile /var/run/miniupnpd.pid
|
||||
log_end_msg $?
|
||||
$IPTABLES_REMOVE > /dev/null 2>&1
|
||||
;;
|
||||
restart|reload|force-reload)
|
||||
log_daemon_msg "Restarting miniupnpd" "miniupnpd"
|
||||
start-stop-daemon --stop --retry 5 --quiet --pidfile /var/run/miniupnpd.pid
|
||||
$IPTABLES_REMOVE > /dev/null 2>&1
|
||||
$IPTABLES_CREATE > /dev/null 2>&1
|
||||
start-stop-daemon --start --quiet --pidfile /var/run/miniupnpd.pid --startas $MINIUPNPD -- $ARGS $LSBNAMES
|
||||
log_end_msg $?
|
||||
;;
|
||||
*) log_action_msg "Usage: /etc/init.d/miniupnpd {start|stop|restart|reload|force-reload}"
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
exit 0
|
Reference in New Issue
Block a user