#! /bin/sh # /etc/init.d/cmus # # Some things that run always touch /var/lock/cmus # Carry out specific functions when asked to by the system case "$1" in start) echo "Starting script cmus " su -c "screen -dmS music" - cmus ;; stop) echo "Stopping script cmus" su -c "screen -S music -X quit" - cmus rm /var/lock/cmus ;; *) echo "Usage: /etc/init.d/cmus {start|stop}" exit 1 ;; esac exit 0