From 4f242678ac804d291176b3f8fade05d498132182 Mon Sep 17 00:00:00 2001 From: edwark43 <97860398+edwark43@users.noreply.github.com> Date: Fri, 22 Mar 2024 08:35:28 -0400 Subject: [PATCH] Update setup.sh --- setup.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/setup.sh b/setup.sh index 74b942d..5db0c56 100644 --- a/setup.sh +++ b/setup.sh @@ -270,9 +270,14 @@ clear ########## --------- Enabling MPD service --------- ########## -printf '%s%sEnabling mpd service%s\n\n' "${CNC}" "${CRE}" "${CNC}" -systemctl enable --now mpd.service -printf "%s%sDone!!%s\n\n" "${BLD}" "${CGR}" "${CNC}" +if systemctl is-enabled --quiet mpd.service; then + printf "\n%s%sDisabling and stopping the global mpd service%s\n" "${BLD}" "${CBL}" "${CNC}" + sudo systemctl stop mpd.service + sudo systemctl disable mpd.service +fi + +printf "\n%s%sEnabling and starting the user-level mpd service%s\n" "${BLD}" "${CYE}" "${CNC}" +systemctl --user enable --now mpd.service sleep 2 clear