Annotation of embedaddon/miniupnpd/linux/miniupnpd.init.d.script, revision 1.1.1.2
1.1 misho 1: #!/bin/sh
1.1.1.2 ! misho 2: # $Id: miniupnpd.init.d.script,v 1.3 2012/03/14 22:09:53 nanard Exp $
1.1 misho 3: # MiniUPnP project
4: # author: Thomas Bernard
5: # website: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
6:
1.1.1.2 ! misho 7: ### BEGIN INIT INFO
! 8: # Provides: miniupnpd
! 9: # Required-Start: $remote_fs $syslog
! 10: # Required-Stop: $remote_fs $syslog
! 11: # Default-Start: 2 3 4 5
! 12: # Default-Stop: 0 1 6
! 13: # Short-Description: MiniUPnPd port-forwarding daemon
! 14: ### END INIT INFO
! 15:
! 16: set -e
! 17:
1.1 misho 18: MINIUPNPD=/usr/sbin/miniupnpd
19: ARGS='-f /etc/miniupnpd/miniupnpd.conf'
20:
21: IPTABLES_CREATE=/etc/miniupnpd/iptables_init.sh
22: IPTABLES_REMOVE=/etc/miniupnpd/iptables_removeall.sh
23:
24: test -f $MINIUPNPD || exit 0
25:
26: . /lib/lsb/init-functions
27:
28: case "$1" in
1.1.1.2 ! misho 29: start)
! 30: log_daemon_msg "Starting miniupnpd" "miniupnpd"
! 31: $IPTABLES_CREATE > /dev/null 2>&1
! 32: start-stop-daemon --start --quiet --pidfile /var/run/miniupnpd.pid --startas $MINIUPNPD -- $ARGS $LSBNAMES
! 33: log_end_msg $?
! 34: ;;
! 35: stop)
! 36: log_daemon_msg "Stopping miniupnpd" "miniupnpd"
! 37: start-stop-daemon --stop --quiet --pidfile /var/run/miniupnpd.pid
! 38: log_end_msg $?
! 39: $IPTABLES_REMOVE > /dev/null 2>&1
! 40: ;;
! 41: restart|reload|force-reload)
! 42: log_daemon_msg "Restarting miniupnpd" "miniupnpd"
! 43: start-stop-daemon --stop --retry 5 --quiet --pidfile /var/run/miniupnpd.pid
! 44: $IPTABLES_REMOVE > /dev/null 2>&1
! 45: $IPTABLES_CREATE > /dev/null 2>&1
! 46: start-stop-daemon --start --quiet --pidfile /var/run/miniupnpd.pid --startas $MINIUPNPD -- $ARGS $LSBNAMES
! 47: log_end_msg $?
! 48: ;;
! 49: status)
! 50: status_of_proc /usr/sbin/miniupnpd miniupnpd
! 51: ;;
! 52: *)
! 53: log_action_msg "Usage: /etc/init.d/miniupnpd {start|stop|restart|reload|force-reload}"
! 54: exit 2
! 55: ;;
1.1 misho 56: esac
57: exit 0
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>