ffpb-debugserver 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides: ffpb-debugserver
  4. # Required-Start: $remote_fs $syslog
  5. # Required-Stop: $remote_fs $syslog
  6. # Default-Start: 2 3 4 5
  7. # Default-Stop:
  8. # Short-Description: Freifunk Paderborn debugserver
  9. ### END INIT INFO
  10. set -e
  11. umask 022
  12. if test -f /etc/default/ffpb-debugserver; then
  13. . /etc/default/ffpb-debugserver
  14. fi
  15. . /lib/lsb/init-functions
  16. export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
  17. case "$1" in
  18. start)
  19. log_daemon_msg "Starting Freifunk Paderborn Debugserver" "ffpb-debugserver" || true
  20. if start-stop-daemon --start --quiet --oknodo --pidfile /var/run/ffpb-debugserver.pid --exec /opt/debugserver/server.py -- $DEBUGSERVER_OPTS; then
  21. log_end_msg 0 || true
  22. else
  23. log_end_msg 1 || true
  24. fi
  25. ;;
  26. stop)
  27. log_daemon_msg "Stopping Freifunk Paderborn Debugserver" "ffpb-debugserver" || true
  28. if start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/ffpb-debugserver.pid; then
  29. log_end_msg 0 || true
  30. else
  31. log_end_msg 1 || true
  32. fi
  33. ;;
  34. restart)
  35. stop
  36. start
  37. ;;
  38. *)
  39. log_action_msg "Usage: $0 {start|stop|restart}" || true
  40. exit 1
  41. esac
  42. exit 0