Update icecast2 FIP relay using HTTP/Json API http://zmpd.zered.net:8042/fip-metadata.mp3
python
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.

init_script 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides: fip-current
  4. # Required-Start: $remote_fs $network icecast2
  5. # Required-Stop: $remote_fs
  6. # Default-Start: 2 3 4 5
  7. # Default-Stop: 0 1 6
  8. # Short-Description: Icecast2 FIP relay metadata update script
  9. # Description: Start updating Icecast2 metadatas using FIP radio wep API
  10. ### END INIT INFO
  11. DPATH="PATH TO SCRIPT"
  12. DAEMON="${DPATH}/fip_current.sh"
  13. NAME="fip-current"
  14. DESC="fip-current update script"
  15. PIDFILE="/run/fip-current.pid"
  16. set_path()
  17. {
  18. echo "DPATH variable not set or wrong in init_script";
  19. exit 1;
  20. }
  21. test -x $DAEMON || set_path
  22. . /lib/lsb/init-functions
  23. case $1 in
  24. start)
  25. log_daemon_msg "Starting $DESC"
  26. if $0 status >/dev/null
  27. then
  28. echo -n " allready running"
  29. log_end_msg 1
  30. else
  31. start-stop-daemon --quiet --start --background -m -p $PIDFILE --exec $DAEMON
  32. log_end_msg $?
  33. fi
  34. ;;
  35. stop)
  36. log_daemon_msg "Stopping $DESC"
  37. start-stop-daemon --stop -p $PIDFILE --remove-pidfile
  38. log_end_msg $?
  39. ;;
  40. restart)
  41. $0 stop
  42. $0 start
  43. ;;
  44. status)
  45. status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
  46. ;;
  47. *)
  48. echo "Usage: $0 {start|stop|restart|status}" >&2
  49. exit 1
  50. ;;
  51. esac