mirror of
https://github.com/unpoller/unpoller.git
synced 2026-10-21 10:16:07 +02:00
Combined after install scripts.
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This file is used by osxpkg packages. FPM use.
|
||||
|
||||
# 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 write logs.
|
||||
chgrp -R admin /usr/local/etc/unifi-poller
|
||||
chmod -R g+wr /usr/local/etc/unifi-poller
|
||||
|
||||
# Make sure admins can write logs.
|
||||
chgrp admin /usr/local/var/log
|
||||
chmod g=rwx /usr/local/var/log
|
||||
|
||||
# This starts it as root. no no no .... not sure how to fix that.
|
||||
# launchctl load /Library/LaunchAgents/com.github.davidnewhall.unifi-poller.plist
|
||||
@@ -1,7 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This file is used by rpm and deb packages. FPM use.
|
||||
# This file is used by deb, rpm and osx packages.
|
||||
# FPM adds this as the after-install script.
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable unifi-poller
|
||||
systemctl restart unifi-poller
|
||||
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 write logs.
|
||||
chgrp -R admin /usr/local/etc/unifi-poller
|
||||
chmod -R g+wr /usr/local/etc/unifi-poller
|
||||
|
||||
# Make sure admins can write logs.
|
||||
chgrp admin /usr/local/var/log
|
||||
chmod g=rwx /usr/local/var/log
|
||||
|
||||
# This starts it as root. no no no .... not sure how to fix that.
|
||||
# launchctl load /Library/LaunchAgents/com.github.davidnewhall.unifi-poller.plist
|
||||
|
||||
elif [ -x "/bin/systemctl" ]; then
|
||||
/bin/systemctl daemon-reload
|
||||
/bin/systemctl enable unifi-poller
|
||||
/bin/systemctl restart unifi-poller
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user