From 30742fbe54df4b62e0e96bf5ba8d8e083e6ab477 Mon Sep 17 00:00:00 2001 From: davidnewhall2 Date: Sat, 1 Feb 2020 04:02:04 -0800 Subject: [PATCH] Rename and fixes --- Makefile | 2 +- examples/MANUAL.md | 8 ++++---- init/bsd/README.md | 2 +- init/bsd/{template.rc.d => freebsd.rc.d} | 4 ++++ 4 files changed, 10 insertions(+), 6 deletions(-) rename init/bsd/{template.rc.d => freebsd.rc.d} (78%) diff --git a/Makefile b/Makefile index 34cbc8ed..76329301 100644 --- a/Makefile +++ b/Makefile @@ -260,7 +260,7 @@ package_build_freebsd: readme man freebsd [ "$(FORMULA)" != "service" ] || mkdir -p $@/usr/local/etc/rc.d [ "$(FORMULA)" != "service" ] || \ sed -e "s/{{BINARY}}/$(BINARY)/g" -e "s/{{BINARYU}}/$(BINARYU)/g" -e "s/{{CONFIG_FILE}}/$(CONFIG_FILE)/g" \ - init/bsd/template.rc.d > $@/usr/local/etc/rc.d/$(BINARY) + init/bsd/freebsd.rc.d > $@/usr/local/etc/rc.d/$(BINARY) [ "$(FORMULA)" != "service" ] || chmod +x $@/usr/local/etc/rc.d/$(BINARY) package_build_freebsd_386: package_build_freebsd freebsd386 diff --git a/examples/MANUAL.md b/examples/MANUAL.md index fcf7e0d3..8dbfb346 100644 --- a/examples/MANUAL.md +++ b/examples/MANUAL.md @@ -3,7 +3,7 @@ unifi-poller(1) -- Utility to poll UniFi Controller Metrics and store them in In SYNOPSIS --- -`unifi-poller -c /etc/unifi-poller.conf` +`unifi-poller -c /etc/unifi-poller/up.conf` This daemon polls a UniFi controller at a short interval and stores the collected measurements in an Influx Database. The measurements and metrics collected belong @@ -51,9 +51,9 @@ OPTIONS CONFIGURATION --- * Config File Default Location: - * Linux: `/etc/unifi-poller.conf` - * macOS/BSD: `/usr/local/etc/unifi-poller.conf` - * Windows: `C:\\ProgramData\\unifi-poller.conf` + * Mac/BSD: `/usr/local/etc/unifi-poller/up.conf` + * Windows: `C:\\ProgramData\\unifi-poller\\up.conf` + * Others: `/etc/unifi-poller/up.conf` * Config File Default Format: `TOML` * Possible formats: `XML`, `JSON`, `TOML`, `YAML` diff --git a/init/bsd/README.md b/init/bsd/README.md index 98cb4145..78e7f58c 100644 --- a/init/bsd/README.md +++ b/init/bsd/README.md @@ -5,5 +5,5 @@ Generic FreeBSD rc.d service file lives here. sed -e "s/{{BINARY}}/app-name/g" \ -e "s/{{BINARYU}}/app_name/g" \ -e "s/{{CONFIG_FILE}}/app-name.conf/g" \ - template.rc.d > /usr/local/etc/rc.d/app-name + freebsd.rc.d > /usr/local/etc/rc.d/app-name ``` diff --git a/init/bsd/template.rc.d b/init/bsd/freebsd.rc.d similarity index 78% rename from init/bsd/template.rc.d rename to init/bsd/freebsd.rc.d index 64b587f3..acfc6990 100755 --- a/init/bsd/template.rc.d +++ b/init/bsd/freebsd.rc.d @@ -27,5 +27,9 @@ load_rc_config ${name} mkdir -p $(dirname ${pidfile}) chown -R ${{BINARYU}}_user $(dirname ${pidfile}) +# Suck in optional exported override variables. +# ie. add something like the following to this file: export UP_POLLER_DEBUG=true +[ -f "/usr/local/etc/defaults/${real_name}" ] && . "/usr/local/etc/defaults/${real_name}" + # Go! run_rc_command "$1"