#!/bin/sh ######################################################################## # Begin $rc_base/init.d/ # # Description : Client175 (MPD Client with Webinterface) # # Author : Arne Fitzenreiter # # Version : 01.00 # # Notes : for www.ipfire.org - GPLv3 # ######################################################################## . /etc/sysconfig/rc . ${rc_functions} case "$1" in start) if [ -e /var/run/client175.pid ]; then if ps -p $(cat /var/run/client175.pid) > /dev/null then boot_mesg "Client175 is already running." echo_failure exit 0 fi fi boot_mesg "Starting Client175 MPD WebIF..." sudo -u nobody python /srv/client175/server.py > /var/log/client175 2>&1 & echo $! > /var/run/client175.pid evaluate_retval ;; stop) if [ ! -e /var/run/client175.pid ]; then boot_mesg "Client175 pidfile not found!" echo_failure exit 0 fi boot_mesg "Stopping Client175 MPD WebIF..." kill $(cat /var/run/client175.pid) evaluate_retval rm -f /var/run/client175.pid ;; restart) ${0} stop sleep 1 ${0} start ;; status) if [ -e /var/run/client175.pid ]; then if ps -p $(cat /var/run/client175.pid) > /dev/null then boot_mesg "Client175 is running with Process Id(s) $(cat /var/run/client175.pid)" exit 0 fi fi boot_mesg "Client175 should not running" exit 0 ;; *) echo "Usage: ${0} {start|stop|reload|restart|status}" exit 1 ;; esac # End $rc_base/init.d/