From bc446ad7642fc44fbea8d2eb593b3bf2c9e74b49 Mon Sep 17 00:00:00 2001 From: David Newhall II Date: Sun, 23 Jun 2019 02:09:46 -0700 Subject: [PATCH] Update after-install.sh --- scripts/after-install.sh | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/scripts/after-install.sh b/scripts/after-install.sh index 820eccc2..acf7bafe 100755 --- a/scripts/after-install.sh +++ b/scripts/after-install.sh @@ -1,28 +1,9 @@ #!/bin/bash -# This file is used by deb, rpm and osx packages. +# This file is used by deb and rpm packages. # FPM adds this as the after-install script. -if [ "$(uname -s)" = "Darwin" ]; then - # Copy the config file into place if it does not exist. - if [ ! -f /usr/local/etc/unifi-poller/up.conf ] && [ -f /usr/local/etc/unifi-poller/up.conf.example ]; then - cp /usr/local/etc/unifi-poller/up.conf.example /usr/local/etc/unifi-poller/up.conf - fi - - # Allow admins to change the configuration and delete the docs. - chgrp -R admin /usr/local/etc/unifi-poller /usr/local/share/doc/unifi-poller - chmod -R g+wr /usr/local/etc/unifi-poller /usr/local/share/doc/unifi-poller - - # Make sure admins can delete logs. - chown -R nobody:admin /usr/local/var/log/unifi-poller - chmod 0775 /usr/local/var/log/unifi-poller - chmod -R g+rw /usr/local/var/log/unifi-poller - - # Restart the service - this starts the application as user nobody. - launchctl unload /Library/LaunchAgents/com.github.davidnewhall.unifi-poller.plist - launchctl load /Library/LaunchAgents/com.github.davidnewhall.unifi-poller.plist - -elif [ -x "/bin/systemctl" ]; then +if [ -x "/bin/systemctl" ]; then # Reload and restart - this starts the application as user nobody. /bin/systemctl daemon-reload /bin/systemctl enable unifi-poller