Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#####
# OSX Machine auth for 802.1x profile
# get AD machine user/pass and put into 802.1x profile template
# install the profile
#
# sed has it's own uses for '&' and '\' in replacements
# and the randomly generated password sometimes has them
# So, trap and escape them before feeding into sed
#
@apizz
apizz / InstallAppleSecurityUpdate.sh
Created March 13, 2018 23:18
Install Apple Security Update
#!/bin/bash
# Variable must match the name exactly as it appears in the `softwareupdate -l` listing
PATCH_TO_MATCH="$4"
# Security Product Key number - AKA /Library/Updates directory with contained updates
SEC_PROD_KEY="$5"
# Defined maximum % of used space allowed in order to download the update
MINPERCENTFREE="$6"
# Custom trigger of DownloadSecurityPatch.sh script policy
CUSTOMTRIGGER="$7"
@apizz
apizz / DownloadAppleSecurityUpdate.sh
Created March 13, 2018 23:06
Download Apple Security Update
#!/bin/bash
# Must match the update name exactly as it appears in the `softwareupdate -l` listing
PATCH_TO_MATCH="$4"
# Security Product ID number - number of the folder in /Library/Updates with contained updates
SEC_PROD_KEY="$5"
# Defined minimum allowed free space % in order to download the update
MINPERCENTFREE="$6"
# Available space of boot volume /
AVAILSPACE=$(/bin/df / | /usr/bin/tail -1 | /usr/bin/awk '{print $4}')
<?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>AutoFillCreditCardData</key>
<false/>
<key>AutoFillFromAddressBook</key>
<false/>
<key>AutoFillPasswords</key>
<false/>
#!/bin/bash
# Apple unique workstation UUID.
UUID=$(/usr/sbin/ioreg -rd1 -c IOPlatformExpertDevice | /usr/bin/perl -ne 'if (m/^.*\"IOPlatformUUID\" = \"(.*).*\"$/im) {print $1}')
# Mac address.
MACADDRESS=$(/usr/sbin/networksetup -getMACADDRESS en0 | /usr/bin/awk '{print $3}' | /usr/bin/sed s/://g)
#* Default preferences.
#+ Modifies /System/Library/User Template