Support uninstall of pkg on os x w/ script.
This commit is contained in:
parent
5a16b93dca
commit
0b10fe2379
|
|
@ -7,6 +7,10 @@ if [ ! -f /usr/local/etc/unifi-poller/up.conf ] && [ -f /usr/local/etc/unifi-pol
|
|||
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
|
||||
|
|
|
|||
|
|
@ -6,14 +6,22 @@
|
|||
|
||||
BINARY=unifi-poller
|
||||
|
||||
echo "Uninstall unifi-poller. If you get errors, you may need sudo."
|
||||
echo "Uninstall unifi-poller. You may need sudo on Linux. Do not use sudo on macOS."
|
||||
|
||||
# Stopping the daemon
|
||||
if [ -x /bin/systemctl ]; then
|
||||
/bin/systemctl stop ${BINARY}
|
||||
fi
|
||||
|
||||
if [ -x /bin/launchctl ] && [ -f ~/Library/LaunchAgents/com.github.davidnewhall.${BINARY}.plist ]; then
|
||||
/bin/launchctl unload ~/Library/LaunchAgents/com.github.davidnewhall.${BINARY}.plist
|
||||
echo Unloading ~/Library/LaunchAgents/com.github.davidnewhall.${BINARY}.plist
|
||||
/bin/launchctl unload ~/Library/LaunchAgents/com.github.davidnewhall.${BINARY}.plist || true
|
||||
fi
|
||||
|
||||
if [ -x /bin/launchctl ] && [ -f /Library/LaunchAgents/com.github.davidnewhall.${BINARY}.plist ]; then
|
||||
echo Unloading /Library/LaunchAgents/com.github.davidnewhall.${BINARY}.plist
|
||||
/bin/launchctl unload /Library/LaunchAgents/com.github.davidnewhall.${BINARY}.plist || true
|
||||
echo "Delete this file manually: sudo rm -f /Library/LaunchAgents/com.github.davidnewhall.${BINARY}.plist"
|
||||
fi
|
||||
|
||||
# Deleting config file, binary, man page, launch agent or unit file.
|
||||
|
|
|
|||
Loading…
Reference in New Issue