#!/bin/bash

cat > /Library/LaunchDaemons/org.amanda.amandad.bsdudp.plist <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
     <key>Label</key>
     <string>org.amanda.amandad.bsdudp</string>
     <key>UserName</key>
     <string>backup</string>
     <key>GroupName</key>
     <string>wheel</string>
     <key>InitGroups</key>
     <true/>
     <key>ProgramArguments</key>
     <array>
          <string>/Users/backup/amanda/libexec/amandad</string>
          <string>-auth=bsdudp amdump amindexd amidxtaped</string>
     </array>
     <key>Sockets</key>
     <dict>
          <key>ipv4</key>
          <dict>
               <key>SockFamily</key>
               <string>IPv4</string>
               <key>SockServiceName</key>
               <string>amanda</string>
               <key>SockType</key>
               <string>dgram</string>
          </dict>
          <key>ipv6</key>
          <dict>
               <key>SockFamily</key>
               <string>IPv6</string>
               <key>SockServiceName</key>
               <string>amanda</string>
               <key>SockType</key>
               <string>dgram</string>
          </dict>
     </dict>
     <key>inetdCompatibility</key>
     <dict>
          <key>Wait</key>
          <false/>
     </dict>
</dict>
</plist>
EOF
