mirror of
https://github.com/unpoller/unpoller.git
synced 2026-10-18 04:35:53 +02:00
Deprecate make install
This commit is contained in:
@@ -6,5 +6,7 @@ if [ "$1" = "upgrade" ] || [ "$1" = "1" ] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
systemctl stop unifi-poller
|
||||
systemctl disable unifi-poller
|
||||
if [ -x "/bin/systemctl" ]; then
|
||||
/bin/systemctl stop unifi-poller
|
||||
/bin/systemctl disable unifi-poller
|
||||
fi
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script creates a local installation of unifi-poller.
|
||||
# Recommend using Makefile to invoke: make install
|
||||
# Supports Linux (systemd only) and macOS.
|
||||
|
||||
BINARY=unifi-poller
|
||||
|
||||
echo "Installing unifi-poller. If you get errors, you may need sudo."
|
||||
|
||||
# Install binary.
|
||||
GOBIN=/usr/local/bin go install -ldflags "-w -s" ./...
|
||||
|
||||
# Making config folders and installing man page.
|
||||
mkdir -p /usr/local/etc/${BINARY} /usr/local/share/man/man1
|
||||
mv *.1.gz /usr/local/share/man/man1
|
||||
|
||||
# Installing config file, man page and launch agent or systemd unit file.
|
||||
if [ ! -f /usr/local/etc/${BINARY}/up.conf ]; then
|
||||
cp examples/up.conf.example /usr/local/etc/${BINARY}/up.conf
|
||||
fi
|
||||
if [ -d ~/Library/LaunchAgents ]; then
|
||||
cp init/launchd/com.github.davidnewhall.${BINARY}.plist ~/Library/LaunchAgents
|
||||
fi
|
||||
if [ -d /etc/systemd/system ]; then
|
||||
cp init/systemd/${BINARY}.service /etc/systemd/system
|
||||
fi
|
||||
|
||||
# Making systemd happy by telling it to reload.
|
||||
if [ -x /bin/systemctl ]; then
|
||||
/bin/systemctl --system daemon-reload
|
||||
/bin/systemctl start unifi-poller
|
||||
/bin/systemctl enable unifi-poller
|
||||
fi
|
||||
|
||||
echo "Installation Complete. Edit the config file @ /usr/local/etc/${BINARY}/up.conf"
|
||||
echo "Then start the daemon with:"
|
||||
if [ -d ~/Library/LaunchAgents ]; then
|
||||
echo " launchctl load ~/Library/LaunchAgents/com.github.davidnewhall.${BINARY}.plist"
|
||||
fi
|
||||
if [ -x /bin/systemctl ]; then
|
||||
echo " sudo /bin/systemctl restart ${BINARY}"
|
||||
fi
|
||||
echo "Examine the log file at: /usr/local/var/log/${BINARY}.log (logs may go elsewhere on linux, check syslog)"
|
||||
Reference in New Issue
Block a user