]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Don't overwrite service files if they already exist.
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Thu, 25 Nov 2021 17:42:48 +0000 (17:42 +0000)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Thu, 25 Nov 2021 17:42:48 +0000 (17:42 +0000)
Makefile.am

index dd8a1bac6550577adcda574e201c4dc0ff45aca4..c8d534402c836666ce2a8b7aaa2e45658c7b4349 100644 (file)
@@ -230,13 +230,13 @@ if INSTALL_SYSTEMV
        getent group shairport-sync &>/dev/null || groupadd -r shairport-sync >/dev/null
        getent passwd shairport-sync &> /dev/null || useradd -r -M -g shairport-sync -s /usr/bin/nologin -G audio shairport-sync >/dev/null
        [ -e $(DESTDIR)$(sysconfdir)/init.d ] || mkdir -p $(DESTDIR)$(sysconfdir)/init.d
-       cp scripts/shairport-sync $(DESTDIR)$(sysconfdir)/init.d/
+       [ -e $(DESTDIR)$(sysconfdir)/init.d/shairport-sync ] || cp scripts/shairport-sync $(DESTDIR)$(sysconfdir)/init.d/
 endif
 if INSTALL_SYSTEMD
        getent group shairport-sync &>/dev/null || groupadd -r shairport-sync >/dev/null
        getent passwd shairport-sync &> /dev/null || useradd -r -M -g shairport-sync -s /usr/bin/nologin -G audio shairport-sync >/dev/null
        [ -e $(DESTDIR)$(systemdsystemunitdir) ] || mkdir -p $(DESTDIR)$(systemdsystemunitdir)
-       cp scripts/shairport-sync.service $(DESTDIR)$(systemdsystemunitdir)
+       [ -e $(DESTDIR)$(systemdsystemunitdir)/shairport-sync.service ] || cp scripts/shairport-sync.service $(DESTDIR)$(systemdsystemunitdir)
 endif
 if INSTALL_FREEBSD_SERVICE
   # Choose a uid and gid of 801 completely arbitrarity, except that it should be below 1000. FreeBSD doesn't seem to allow you to say "an ID in the range of..."
@@ -244,9 +244,9 @@ if INSTALL_FREEBSD_SERVICE
        pw showuser shairport-sync > /dev/null 2>&1 || pw adduser -c "shairport-sync unprivileged user" -n shairport-sync -u 801 -s /usr/sbin/nologin -d /nonexistent > /dev/null 2>&1
        [ -e /var/run/shairport-sync ] || mkdir -p /var/run/shairport-sync
        chown shairport-sync:shairport-sync /var/run/shairport-sync
-       cp scripts/shairport-sync.freebsd /usr/local/etc/rc.d/shairport_sync
+       [ -e /usr/local/etc/rc.d/shairport_sync ] || cp scripts/shairport-sync.freebsd /usr/local/etc/rc.d/shairport_sync
        chmod 555 /usr/local/etc/rc.d/shairport_sync
 endif
 if INSTALL_CYGWIN_SERVICE
-       cp scripts/shairport-sync-config /usr/local/bin
+       [ -e /usr/local/bin/shairport-sync-config ] || cp scripts/shairport-sync-config /usr/local/bin
 endif