diff --git a/templates/unifi-poller.rb.tmpl b/templates/unifi-poller.rb.tmpl
index 3a73cb8a..e438fa05 100644
--- a/templates/unifi-poller.rb.tmpl
+++ b/templates/unifi-poller.rb.tmpl
@@ -22,40 +22,44 @@ class UnifiPoller < Formula
cd bin_path do
system "dep", "ensure"
system "make", "install", "VERSION=#{version}", "PREFIX=#{prefix}", "ETC=#{etc}"
+ system "mkdir", "-p", "#{var}/log/unifi-poller"
end
end
+ def caveats
+ s = <<-EOS
+ This application will not work until the config file has authentication
+ information for a Unifi Controller and an Influx Database. Edit the config
+ file at #{etc}/unifi-poller/up.conf then start the application with
+ brew services start unifi-poller ~ log file: #{var}/log/unifi-poller/log
+ The manual explains the config file options: man unifi-poller
+ EOS
+ end
- plist_options :startup => true
-
- def plist; <<-EOS
-
-
-
-
- Label
- #{plist_name}
- ProgramArguments
-
- #{bin}/unifi-poller
- -c
- #{etc}/unifi-poller/up.conf
-
- RunAtLoad
-
- KeepAlive
-
- StandardErrorPath
- #{var}/log/unifi-poller/log
- StandardOutPath
- #{var}/log/unifi-poller/log
- UserName
- nobody
- GroupName
- nobody
-
-
- EOS
- end
+ def plist; <<-EOS
+
+
+
+
+ Label
+ #{plist_name}
+ ProgramArguments
+
+ #{bin}/unifi-poller
+ -c
+ #{etc}/unifi-poller/up.conf
+
+ RunAtLoad
+
+ KeepAlive
+
+ StandardErrorPath
+ #{var}/log/unifi-poller/log
+ StandardOutPath
+ #{var}/log/unifi-poller/log
+
+
+ EOS
+ end
test do
assert_match "unifi-poller v#{version}", shell_output("#{bin}/unifi-poller -v 2>&1", 2)