You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.2 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #!/bin/sh
  2. # $Id: minissdpd.init.d.script,v 1.3 2015/05/22 10:57:42 nanard Exp $
  3. # MiniUPnP project
  4. # author: Thomas Bernard
  5. # website: http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
  6. MINISSDPD=/usr/sbin/minissdpd
  7. PIDFILE=/var/run/minissdpd.pid
  8. # get default interface
  9. IF=`route | grep default |awk -- '{ print $8 }'`
  10. ARGS="-i $IF"
  11. test -f $MINISSDPD || exit 0
  12. . /lib/lsb/init-functions
  13. case "$1" in
  14. start) log_daemon_msg "Starting minissdpd" "minissdpd"
  15. start-stop-daemon --start --quiet --pidfile $PIDFILE \
  16. --exec $MINISSDPD -- $ARGS $LSBNAMES
  17. log_end_msg $?
  18. ;;
  19. stop) log_daemon_msg "Stopping minissdpd" "minissdpd"
  20. start-stop-daemon --stop --quiet --pidfile $PIDFILE
  21. log_end_msg $?
  22. ;;
  23. restart|reload|force-reload)
  24. log_daemon_msg "Restarting minissdpd" "minissdpd"
  25. start-stop-daemon --stop --retry 5 --quiet --pidfile $PIDFILE
  26. start-stop-daemon --start --quiet --pidfile $PIDFILE \
  27. --exec $MINISSDPD -- $ARGS $LSBNAMES
  28. log_end_msg $?
  29. ;;
  30. *) log_action_msg "Usage: /etc/init.d/minissdpd {start|stop|restart|reload|force-reload}"
  31. exit 2
  32. ;;
  33. esac
  34. exit 0