123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #! /bin/sh
- ### BEGIN INIT INFO
- # Provides: fip-current
- # Required-Start: $remote_fs $network icecast2
- # Required-Stop: $remote_fs
- # Default-Start: 2 3 4 5
- # Default-Stop: 0 1 6
- # Short-Description: Icecast2 FIP relay metadata update script
- # Description: Start updating Icecast2 metadatas using FIP radio wep API
- ### END INIT INFO
-
- DPATH="PATH TO SCRIPT"
-
- DAEMON="${DPATH}/fip_current.sh"
- NAME="fip-current"
- DESC="fip-current update script"
- PIDFILE="/run/fip-current.pid"
-
- set_path()
- {
- echo "DPATH variable not set or wrong in init_script";
- exit 1;
- }
-
- test -x $DAEMON || set_path
-
- . /lib/lsb/init-functions
-
- case $1 in
- start)
-
- log_daemon_msg "Starting $DESC"
- if $0 status >/dev/null
- then
- echo -n " allready running"
- log_end_msg 1
- else
- start-stop-daemon --quiet --start --background -m -p $PIDFILE --exec $DAEMON
- log_end_msg $?
- fi
-
- ;;
- stop)
- log_daemon_msg "Stopping $DESC"
- start-stop-daemon --stop -p $PIDFILE --remove-pidfile
- log_end_msg $?
- ;;
- restart)
- $0 stop
- $0 start
- ;;
- status)
- status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
- ;;
- *)
- echo "Usage: $0 {start|stop|restart|status}" >&2
- exit 1
- ;;
- esac
|