-
-
Save fleger/1960771 to your computer and use it in GitHub Desktop.
MPD User Daemon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
. /etc/rc.conf | |
. /etc/rc.d/functions | |
. /etc/user-rc.d/functions | |
case "$1" in | |
start) | |
stat_busy "Starting Music Player Daemon" | |
/usr/bin/mpd "${XDG_CONFIG_HOME:-${HOME}/.config}/mpd/mpd.conf" &> /dev/null | |
if [ $? -gt 0 ]; then | |
stat_fail | |
else | |
add_user_daemon mpd | |
stat_done | |
fi | |
;; | |
stop) | |
stat_busy "Stopping Music Player Daemon" | |
/usr/bin/mpd --kill "${XDG_CONFIG_HOME:-${HOME}/.config}/mpd/mpd.conf" &> /dev/null | |
if [ $? -gt 0 ]; then | |
stat_fail | |
else | |
rm_user_daemon mpd | |
stat_done | |
fi | |
;; | |
restart) | |
$0 stop | |
sleep 1 | |
$0 start | |
;; | |
status) | |
stat_busy "Checking Music Player Daemon status" | |
ck_user_status mpd | |
;; | |
*) | |
echo "usage: $0 {start|stop|restart|status}" | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use this script with https://github.com/fleger/user-initscripts