From Python to shell script
- Allowing to run mpd + icecast2 + fip relay with metadatas on a VM with 128Mo of memory. - Calculating when to update (given the end field in the JSON)
This commit is contained in:
parent
d35735cf65
commit
bcafd50a3d
5 changed files with 52 additions and 213 deletions
11
init_script
11
init_script
|
|
@ -9,14 +9,11 @@
|
|||
# Description: Start updating Icecast2 metadatas using FIP radio wep API
|
||||
### END INIT INFO
|
||||
|
||||
DPATH=/PUT/SCRIPT/PATH/HERE
|
||||
DPATH="PATH TO SCRIPT"
|
||||
|
||||
SCRIPT="fip_current.py"
|
||||
DAEMON="${DPATH}/${SCRIPT}"
|
||||
CONFIG="${DPATH}/conf.ini"
|
||||
DAEMON="${DPATH}/fip_current.sh"
|
||||
NAME="fip-current"
|
||||
DESC="fip-current update script"
|
||||
DAEMON_OPTS="-ul -c $CONFIG"
|
||||
PIDFILE="/run/fip-current.pid"
|
||||
|
||||
set_path()
|
||||
|
|
@ -38,14 +35,14 @@ case $1 in
|
|||
echo -n " allready running"
|
||||
log_end_msg 1
|
||||
else
|
||||
start-stop-daemon --quiet --start --background -m -p $PIDFILE --exec $DAEMON -- $DAEMON_OPTS
|
||||
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 -x $DAEMON
|
||||
start-stop-daemon --stop -p $PIDFILE --remove-pidfile
|
||||
log_end_msg $?
|
||||
;;
|
||||
restart)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue