github.com/dahs81/otto@v0.2.1-0.20160126165905-6400716cf085/images/scripts/macosx/networking.sh (about) 1 #!/bin/sh -eux 2 3 # Thank you to https://github.com/timsutton/osx-vm-templates 4 # for the implementation 5 6 # This script adds a Mac OS Launch Daemon, which runs every time the 7 # machine is booted. The daemon will re-detect the attached network 8 # interfaces. If this is not done, network devices may not work. 9 plist=/Library/LaunchDaemons/com.github.timsutton.osx-vm-templates.detectnewhardware.plist; 10 11 cat <<PLIST >"$plist"; 12 <?xml version="1.0" encoding="UTF-8"?> 13 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 14 <plist version="1.0"> 15 <dict> 16 <key>Label</key> 17 <string>com.github.timsutton.osx-vm-templates.detectnewhardware</string> 18 <key>ProgramArguments</key> 19 <array> 20 <string>/usr/sbin/networksetup</string> 21 <string>-detectnewhardware</string> 22 </array> 23 <key>RunAtLoad</key> 24 <true/> 25 </dict> 26 </plist> 27 PLIST 28 29 # These should be already set as follows, but since they're required 30 # in order to load properly, we set them explicitly. 31 chmod 644 "$plist"; 32 chown root:wheel "$plist";