]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
osx: replace plist by service in brew recipe
authorVincent Bernat <vincent@bernat.ch>
Fri, 10 Sep 2021 06:35:40 +0000 (08:35 +0200)
committerVincent Bernat <vincent@bernat.ch>
Fri, 10 Sep 2021 06:35:40 +0000 (08:35 +0200)
osx/lldpd.rb

index c73157d70dac61d28c69b99c774a4c5e8d7c2e04..e8f0d5638920cf23f02ee5b08ce3093e1edc34f3 100644 (file)
@@ -81,26 +81,8 @@ class Lldpd < Formula
   end
 
   plist_options startup: true
-
-  def plist
-    additional_args = ""
-    additional_args += "<string>-x</string>" if build.with? "snmp"
-    <<~EOS
-      <?xml version="1.0" encoding="UTF-8"?>
-      <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-      <plist version="1.0">
-      <dict>
-        <key>Label</key>
-        <string>#{plist_name}</string>
-        <key>ProgramArguments</key>
-        <array>
-          <string>#{opt_sbin}/lldpd</string>
-          #{additional_args}
-        </array>
-        <key>RunAtLoad</key><true/>
-        <key>KeepAlive</key><true/>
-      </dict>
-      </plist>
-    EOS
+  service do
+    run build.with?("snmp") ? [opt_sbin/"lldpd", "-x"] : opt_sbin/"lldpd"
+    keep_alive true
   end
 end