Fix homebrew formula template
This commit is contained in:
parent
8cd80fcf83
commit
094705d76c
|
|
@ -22,40 +22,44 @@ class UnifiPoller < Formula
|
||||||
cd bin_path do
|
cd bin_path do
|
||||||
system "dep", "ensure"
|
system "dep", "ensure"
|
||||||
system "make", "install", "VERSION=#{version}", "PREFIX=#{prefix}", "ETC=#{etc}"
|
system "make", "install", "VERSION=#{version}", "PREFIX=#{prefix}", "ETC=#{etc}"
|
||||||
|
system "mkdir", "-p", "#{var}/log/unifi-poller"
|
||||||
end
|
end
|
||||||
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
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
def plist; <<-EOS
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<plist version="1.0">
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<dict>
|
||||||
<plist version="1.0">
|
<key>Label</key>
|
||||||
<dict>
|
<string>#{plist_name}</string>
|
||||||
<key>Label</key>
|
<key>ProgramArguments</key>
|
||||||
<string>#{plist_name}</string>
|
<array>
|
||||||
<key>ProgramArguments</key>
|
<string>#{bin}/unifi-poller</string>
|
||||||
<array>
|
<string>-c</string>
|
||||||
<string>#{bin}/unifi-poller</string>
|
<string>#{etc}/unifi-poller/up.conf</string>
|
||||||
<string>-c</string>
|
</array>
|
||||||
<string>#{etc}/unifi-poller/up.conf</string>
|
<key>RunAtLoad</key>
|
||||||
</array>
|
<true/>
|
||||||
<key>RunAtLoad</key>
|
<key>KeepAlive</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>KeepAlive</key>
|
<key>StandardErrorPath</key>
|
||||||
<true/>
|
<string>#{var}/log/unifi-poller/log</string>
|
||||||
<key>StandardErrorPath</key>
|
<key>StandardOutPath</key>
|
||||||
<string>#{var}/log/unifi-poller/log</string>
|
<string>#{var}/log/unifi-poller/log</string>
|
||||||
<key>StandardOutPath</key>
|
</dict>
|
||||||
<string>#{var}/log/unifi-poller/log</string>
|
</plist>
|
||||||
<key>UserName</key>
|
EOS
|
||||||
<string>nobody</string>
|
end
|
||||||
<key>GroupName</key>
|
|
||||||
<string>nobody</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
EOS
|
|
||||||
end
|
|
||||||
|
|
||||||
test do
|
test do
|
||||||
assert_match "unifi-poller v#{version}", shell_output("#{bin}/unifi-poller -v 2>&1", 2)
|
assert_match "unifi-poller v#{version}", shell_output("#{bin}/unifi-poller -v 2>&1", 2)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue