galene.rc 754 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/sh
  2. # Start script for FreeBSD, contributed by user Fabian Abplanalp
  3. # Put this script in /usr/local/etc/rc.d then adjust GALENE_BIN and
  4. # GALENE_CFG values in /etc/defaults/galene
  5. GALENE_BIN="/usr/local/bin/galene"
  6. GALENE_PID="/var/run/galene.pid"
  7. # Read configuration variable file if it is present
  8. [ -r /etc/defaults/galene ] && . /etc/defaults/galene
  9. case "$1" in
  10. "start")
  11. echo "Starting galene..."
  12. ${GALENE_BIN} &
  13. echo $! >${GALENE_PID}
  14. echo "done"
  15. ;;
  16. "stop")
  17. echo "Stopping galene..."
  18. if [ -f ${GALENE_PID} ]; then
  19. kill $(cat ${GALENE_PID})
  20. rm ${GALENE_PID}
  21. echo "done"
  22. else
  23. echo "not running?"
  24. fi
  25. ;;
  26. "restart")
  27. echo "Restarting galene..."
  28. $0 stop
  29. sleep 2
  30. $0 start
  31. ;;
  32. *)
  33. echo "$0 [start|stop|restart]"
  34. ;;
  35. esac