This commit is contained in:
davidnewhall2 2020-02-01 02:21:22 -08:00
parent 402aeda5f0
commit e4c3fe52b3
3 changed files with 12 additions and 6 deletions

View File

@ -40,7 +40,7 @@ $(PACKAGE_SCRIPTS) \
--vendor "$(VENDOR)" \
--description "$(DESC)" \
--config-files "/etc/$(BINARY)/$(CONFIG_FILE)" \
--freebsd-origin "golift/$(BINARY)"
--freebsd-origin "$(BINARY)/$(BINARY)"
endef
PLUGINS:=$(patsubst plugins/%/main.go,%,$(wildcard plugins/*/main.go))

View File

@ -1,11 +1,14 @@
#!/bin/bash
#!/bin/sh
# This file is used by deb and rpm packages.
# FPM adds this as the after-install script.
# This file is used by txz, deb and rpm packages.
# FPM adds this as the after-install script to all packages.
if [ -x "/bin/systemctl" ]; then
# Reload and restart - this starts the application as user nobody.
/bin/systemctl daemon-reload
/bin/systemctl enable unifi-poller
/bin/systemctl restart unifi-poller
elif [ -x /usr/sbin/service ]; then
# Do not start or restart on freebsd. That's "bad practice."
/usr/sbin/service unifi-poller enabled || /usr/sbin/service unifi-poller enable
fi

View File

@ -1,6 +1,6 @@
#!/bin/bash
#!/bin/sh
# This file is used by rpm and deb packages. FPM use.
# This file is used by txz, rpm and deb packages. FPM use.
if [ "$1" = "upgrade" ] || [ "$1" = "1" ] ; then
exit 0
@ -9,4 +9,7 @@ fi
if [ -x "/bin/systemctl" ]; then
/bin/systemctl stop unifi-poller
/bin/systemctl disable unifi-poller
elif [ -x /usr/sbin/service ]; then
/usr/sbin/service unifi-poller stop
/usr/sbin/service unifi-poller disable
fi