├── .gitignore ├── AD_Group_Appliction_Launcher ├── AD_Group_Appliction_Launcher.sh └── README.md ├── Add current user to Filevault.sh ├── Adobe Acrobat Pro └── Set Adobe Acrobat Pro as PDF handler.sh ├── Adobe InCopy CS6 └── Adobe InCopy CS6 - Remove CSXS plugin to prevent crash on quit per user.sh ├── Adobe_CS6_MC_Cleanup ├── Adobe_CS6_MC_Cleanup_Script.sh └── README.md ├── Autodesk_Installer_Scripts ├── Autodesk_AutoCAD_2015 │ └── scripts │ │ └── postinstall ├── Autodesk_AutoCAD_2017 │ └── scripts │ │ └── postinstall ├── Autodesk_Maya_2016 │ └── scripts │ │ └── postinstall ├── Autodesk_Maya_2017 │ └── scripts │ │ └── postinstall ├── Autodesk_Maya_2018 │ └── scripts │ │ ├── install_and_activate_maya_2018_single.sh │ │ └── setup_maya_2018.sh ├── Autodesk_Mudbox_2016 │ └── scripts │ │ └── postinstall ├── Autodesk_Mudbox_2017 │ └── scripts │ │ └── postinstall ├── Autodesk_Sketchbook_Pro_2016 │ └── scripts │ │ └── postinstall └── Autodesk_Sketchbook_Pro_2018 │ └── scripts │ └── postinstall ├── FileZilla └── Filezilla - Suppress first run per user.sh ├── FxFactory └── FxFactory Helper Tool installer.sh ├── Google_Chrome_Setup ├── Google Chrome Master Preferences ├── Google Chrome Setup Script.py └── chrome-enable-autoupdates.py ├── Imagr_101 ├── README.md └── imagr_config.plist ├── Outlook_2016 └── Change_email_Domain │ ├── Change Outlook Exchange email domains - BASH.scpt │ └── Change Outlook Exchange email domains.scpt ├── Pro Tools 12 └── ProTools12_Post-Install-Script.sh ├── RADIUS └── EAP-Username-Injector.sh ├── README.md ├── ableton_live_9 ├── Library.cfg ├── Move Ableton License file to system-wide.sh └── Options.txt ├── addWebShortcutToDesktop.sh ├── appQuit ├── README.md └── quit.sh ├── certExpiryCheckEA.sh ├── check_ad_jss.sh ├── configureLoginWindowAccess.sh ├── createRecovery.sh ├── delete_folders.sh ├── delete_keychains ├── README.md └── delete_keychains.sh ├── disableJavaAutoUpdates.sh ├── disable_flash_auto_updates.sh ├── distnoted_watchdog ├── pkgbuild │ ├── ROOT │ │ ├── Library │ │ │ └── LaunchDaemons │ │ │ │ └── uk.co.amsys.distnoted_watchdog.plist │ │ └── usr │ │ │ └── local │ │ │ └── bin │ │ │ └── distnoted_watchdog.sh │ ├── distnoted_watchdog-1.1.pkg │ └── scripts │ │ ├── postinstall │ │ └── preinstall └── readme.md ├── first_boot ├── 10.10_firstBoot.sh ├── 10.12_first_boot.sh └── 10.9_firstBoot.sh ├── in-placeUpgrade_high_sierra.sh ├── issueNewFileVaultRecoveryKey.sh ├── macOS └── Software Updates │ ├── EA - List_Configuration_Data_Updates.sh │ └── Install_Configuration_Data_Updates.sh ├── mount_SMBHome ├── README.txt └── mounthome.sh ├── printerConnect.sh ├── removeProfile.sh ├── resetHomeOwnership ├── README.txt └── resetHomeOwner.sh ├── set_safari_homepage.sh ├── set_wallpaper ├── README.md └── setWallpaper.sh ├── shareConnect.sh ├── shareConnectGroupCheck.sh ├── suppressUpdateCheckForVisualStudio.sh ├── testswup ├── uninstall_crashplan └── uninstall_crashplan.sh └── uploadPackagesJSSAPI.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | ._* 3 | -------------------------------------------------------------------------------- /AD_Group_Appliction_Launcher/AD_Group_Appliction_Launcher.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Created by Darren Wallace - Amsys 4 | # 5 | 6 | username="$3" 7 | if [ -z "$username" ]; then # Checks if the variable is empty (user running script from Self Service) 8 | username="$USER" 9 | fi 10 | echo "User: $username" 11 | Group1="$4" # This is the first group to launch the first app for (staff) 12 | echo "AD User Group 1: $4" 13 | Group2="$5" # This is the second group to launch the second app for (student) 14 | echo "AD User Group 2: $5" 15 | Group1AppLocation="$6" # This is the full path to the first app (staff) 16 | echo "First App Location: $6" 17 | Group2AppLocation="$7" # This is the full path to the second app (student) 18 | echo "Second App Location: $7" 19 | 20 | # Check that the user is in group 1 (Staff) 21 | groupCheck=`dseditgroup -o checkmember -m $username "$Group1" | grep -c "yes"` 22 | if [ "${groupCheck}" -ne 0 ]; then 23 | su "$username" -c "$(open -F $Group1AppLocation)" 24 | exit 0 25 | fi 26 | 27 | # Check that the user is in group 2 (Student) 28 | groupCheck=`dseditgroup -o checkmember -m $username "$Group2" | grep -c "yes"` 29 | if [ "${groupCheck}" -ne 0 ]; then 30 | su "$username" -c "$(open -F $Group2AppLocation)" 31 | fi 32 | 33 | exit 0 -------------------------------------------------------------------------------- /AD_Group_Appliction_Launcher/README.md: -------------------------------------------------------------------------------- 1 | This script can be used to launch two different applications depending on the logging in user's AD Group. 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /Add current user to Filevault.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## Self Service policy to add the logged in user to the enabled list 4 | ## of FileVault 2 users. 5 | 6 | ## Pass the credentials for an admin account that is authorized with FileVault 2 7 | adminName="${4}" 8 | adminPass="${5}" 9 | 10 | if [[ "${adminName}" == "" ]]; 11 | then 12 | echo "Username undefined. Please pass the management account username in parameter 4" 13 | exit 1 14 | fi 15 | 16 | if [[ "${adminPass}" == "" ]]; 17 | then 18 | echo "Password undefined. Please pass the management account password in parameter 5" 19 | exit 2 20 | fi 21 | 22 | ## Get the logged in user's name 23 | userName=$(python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");') 24 | 25 | ## This first user check sees if the logged in account is already authorized with FileVault 2 26 | userCheck=$(fdesetup list | awk -v usrN="$userName" -F, 'index($0, usrN) {print $1}') 27 | if [[ "${userCheck}" == "${userName}" ]]; 28 | then 29 | echo "This user is already added to the FileVault 2 list." 30 | exit 3 31 | fi 32 | 33 | # ## Check to see if the encryption process is complete 34 | # encryptCheck=$(fdesetup status) 35 | # statusCheck=$(echo "${encryptCheck}" | grep "FileVault is On.") 36 | # expectedStatus="FileVault is On." 37 | # if [[ "${statusCheck}" != "${expectedStatus}" ]]; 38 | # then 39 | # echo "The encryption process has not completed, unable to add user at this time." 40 | # echo "${encryptCheck}" 41 | # exit 4 42 | # fi 43 | 44 | ## Get the logged in user's password via a prompt 45 | echo "Prompting ${userName} for their login password." 46 | userPass="$(osascript -e 'Tell application "System Events" to display dialog "Please enter your login password:" default answer "" with title "Login Password" with text buttons {"Ok"} default button 1 with hidden answer' -e 'text returned of result')" 47 | 48 | echo "Adding user to FileVault 2 list." 49 | 50 | # create the plist file: 51 | echo ' 52 | 53 | 54 | 55 | Username 56 | '$4' 57 | Password 58 | '$5' 59 | AdditionalUsers 60 | 61 | 62 | Username 63 | '$userName' 64 | Password 65 | '$userPass' 66 | 67 | 68 | 69 | ' > /tmp/fvenable.plist 70 | 71 | # now enable FileVault 72 | fdesetup add -i < /tmp/fvenable.plist 73 | 74 | ## This second user check sees if the logged in account was successfully added to the FileVault 2 list 75 | userCheck=$(fdesetup list | awk -v usrN="$userName" -F, 'index($0, usrN) {print $1}') 76 | if [[ "${userCheck}" != "${userName}" ]]; 77 | then 78 | echo "Failed to add user to FileVault 2 list." 79 | exit 5 80 | fi 81 | 82 | echo "${userName} has been added to the FileVault 2 list." 83 | /usr/local/bin/jamf recon -------------------------------------------------------------------------------- /Adobe Acrobat Pro/Set Adobe Acrobat Pro as PDF handler.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # DW - Amsys - 2016.09.14 4 | # Will use Duti to set the default PDF handler to Acrobat Pro 5 | # 6 | 7 | PathToDuti="/usr/local/bin/duti" 8 | 9 | ##### ADVANCED MODIFICATION ONY BELOW THIS LINE ##### 10 | 11 | # Create a log writing function 12 | writelog() 13 | { 14 | echo "${1}" 15 | } 16 | 17 | writelog "STARTING: Set PDF viewer" 18 | 19 | username="$3" 20 | if [ -z "$username" ]; then # Checks if the variable is empty (user running script from Self Service) 21 | USERNAME=$(python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");') 22 | fi 23 | 24 | if [[ -e "${PathToDuti}" ]]; then 25 | echo "Duri binary found" 26 | su "${username}" -c "${PathToDuti} -s com.adobe.Acrobat.Pro pdf all" 27 | else 28 | echo "Duti binary not installed at ${PathToDuti}, skipped" 29 | fi 30 | 31 | exit 0 32 | 33 | 34 | -------------------------------------------------------------------------------- /Adobe InCopy CS6/Adobe InCopy CS6 - Remove CSXS plugin to prevent crash on quit per user.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # DW - Amsys - 2016.09.14 4 | # Uses the Extension Manager CS6 app to remove the CSXS extension per user 5 | # 6 | 7 | username="$3" 8 | if [ -z "$username" ] || [[ "$username" == "root" ]]; then # Checks if the variable is empty (user running script from Self Service) 9 | username=$(python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");') 10 | fi 11 | echo "Logging in user: $username" 12 | 13 | if [ -z "$username" ] || [[ "$username" == "root" ]] || [[ "$username" == "" ]]; then 14 | echo "Username not correctly detected, exiting...." 15 | exit 1 16 | fi 17 | 18 | PathForBinary="/Applications/Adobe\ Extension\ Manager\ CS6/Adobe\ Extension\ Manager\ CS6.app/Contents/MacOS/Adobe\ Extension\ Manager\ CS6" 19 | 20 | if [[ -a "${PathForBinary}" ]]; then 21 | su "${username}" -c "${PathForBinary} -suppress -remove product="InCopy CS6" extension="CSXS"" 22 | else 23 | echo "Binary not found, exiting..." 24 | exit 0 25 | fi 26 | 27 | exit 0 28 | -------------------------------------------------------------------------------- /Adobe_CS6_MC_Cleanup/Adobe_CS6_MC_Cleanup_Script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Darren Wallace - Amsys 4 | # Script using the "Chflags" command to hide a number of unwanted Adobe installed items. 5 | 6 | echo "STARTING ADOBE CLEANUP" 7 | # Starting at the "/Applications" folder 8 | 9 | # Random top level Adobe folder 10 | chflags hidden "/Applications/Adobe" 11 | 12 | # The Adobe Acrobat Pro uninstaller 13 | ## For some reason this cannot be hidden and must be removed. 14 | rm "/Applications/Adobe Acrobat X Pro/Acrobat X Uninstaller" 15 | 16 | # Adobe After Effects CS6 17 | chflags hidden "/Applications/Adobe After Effects CS6/aerender" 18 | chflags hidden "/Applications/Adobe After Effects CS6/Legal" 19 | chflags hidden "/Applications/Adobe After Effects CS6/Plug-ins" 20 | chflags hidden "/Applications/Adobe After Effects CS6/Presets" 21 | chflags hidden "/Applications/Adobe After Effects CS6/Scripts" 22 | chflags hidden "/Applications/Adobe After Effects CS6/Uninstall Adobe After Effects CS6" 23 | 24 | # Adobe Audition CS6 25 | chflags hidden "/Applications/Adobe Audition CS6/Legal" 26 | chflags hidden "/Applications/Adobe Audition CS6/Uninstall Adobe Audition CS6" 27 | 28 | # Adobe Bridge CS6 29 | chflags hidden "/Applications/Adobe Bridge CS6/Legal" 30 | chflags hidden "/Applications/Adobe Bridge CS6/Plug-Ins" 31 | chflags hidden "/Applications/Adobe Bridge CS6/Presets" 32 | chflags hidden "/Applications/Adobe Bridge CS6/Required" 33 | 34 | # Adobe Dreamweaver CS6 35 | chflags hidden "/Applications/Adobe Dreamweaver CS6/Configuration" 36 | chflags hidden "/Applications/Adobe Dreamweaver CS6/en_US" 37 | chflags hidden "/Applications/Adobe Dreamweaver CS6/Installer" 38 | chflags hidden "/Applications/Adobe Dreamweaver CS6/Legal" 39 | chflags hidden "/Applications/Adobe Dreamweaver CS6/Sample_files" 40 | chflags hidden "/Applications/Adobe Dreamweaver CS6/Uninstall Adobe Dreamweaver CS6" 41 | 42 | # Adobe Encore CS6 43 | chflags hidden "/Applications/Adobe Encore CS6/Legal" 44 | chflags hidden "/Applications/Adobe Encore CS6/Uninstall Adobe Encore CS6" 45 | 46 | # Adobe Extension Manager CS6 47 | chflags hidden "/Applications/Adobe Extension Manager CS6/Legal" 48 | chflags hidden "/Applications/Adobe Extension Manager CS6/Resources" 49 | 50 | # Adobe Fireworks CS6 51 | chflags hidden "/Applications/Adobe Fireworks CS6/bridgeDefaultLanguage" 52 | chflags hidden "/Applications/Adobe Fireworks CS6/Configuration" 53 | chflags hidden "/Applications/Adobe Fireworks CS6/Legal" 54 | chflags hidden "/Applications/Adobe Fireworks CS6/Required" 55 | chflags hidden "/Applications/Adobe Fireworks CS6/Uninstall Adobe Fireworks CS6" 56 | 57 | # Adobe Flash Builder CS6 58 | chflags hidden "/Applications/Adobe Flash Builder 4.6/Adobe Flash Builder 4.6 - Bitte lesen.pdf" 59 | chflags hidden "/Applications/Adobe Flash Builder 4.6/Adobe Flash Builder 4.6 — Lisez-moi.pdf" 60 | chflags hidden "/Applications/Adobe Flash Builder 4.6/Adobe Flash Builder 4.6 Read Me.pdf" 61 | chflags hidden "/Applications/Adobe Flash Builder 4.6/Adobe Flash Builder 4.6 お読みください.pdf" 62 | chflags hidden "/Applications/Adobe Flash Builder 4.6/Adobe Flash Builder 4.6 自述.pdf" 63 | chflags hidden "/Applications/Adobe Flash Builder 4.6/assets" 64 | chflags hidden "/Applications/Adobe Flash Builder 4.6/configuration" 65 | chflags hidden "/Applications/Adobe Flash Builder 4.6/dropins" 66 | chflags hidden "/Applications/Adobe Flash Builder 4.6/eclipse" 67 | chflags hidden "/Applications/Adobe Flash Builder 4.6/Legal" 68 | chflags hidden "/Applications/Adobe Flash Builder 4.6/p2" 69 | chflags hidden "/Applications/Adobe Flash Builder 4.6/player" 70 | chflags hidden "/Applications/Adobe Flash Builder 4.6/sdks" 71 | chflags hidden "/Applications/Adobe Flash Builder 4.6/utilities" 72 | chflags hidden "/Applications/Adobe Flash Builder 4.6/Важное о Adobe Flash Builder 4.6.pdf" 73 | chflags hidden "/Applications/Adobe Flash Builder 4.6/Uninstall Adobe Flash Builder 4.6" 74 | 75 | # Adobe Flash CS6 76 | chflags hidden "/Applications/Adobe Flash CS6/AIR3.2" 77 | chflags hidden "/Applications/Adobe Flash CS6/AIR3.4" 78 | chflags hidden "/Applications/Adobe Flash CS6/Common" 79 | chflags hidden "/Applications/Adobe Flash CS6/en_US" 80 | chflags hidden "/Applications/Adobe Flash CS6/Legal" 81 | chflags hidden "/Applications/Adobe Flash CS6/Players" 82 | chflags hidden "/Applications/Adobe Flash CS6/XManConfig.xml" 83 | chflags hidden "/Applications/Adobe Flash CS6/Uninstall Adobe Flash CS6" 84 | 85 | # Adobe Illustrator CS6 86 | chflags hidden "/Applications/Adobe Illustrator CS6/Configuration" 87 | chflags hidden "/Applications/Adobe Illustrator CS6/Cool Extras.localized" 88 | chflags hidden "/Applications/Adobe Illustrator CS6/Legal" 89 | chflags hidden "/Applications/Adobe Illustrator CS6/Plug-ins.localized" 90 | chflags hidden "/Applications/Adobe Illustrator CS6/Presets.localized" 91 | chflags hidden "/Applications/Adobe Illustrator CS6/Read Me.localized" 92 | chflags hidden "/Applications/Adobe Illustrator CS6/Scripting.localized" 93 | chflags hidden "/Applications/Adobe Illustrator CS6/Uninstall Adobe Illustrator CS6" 94 | 95 | # Adobe InDesign CS6 96 | chflags hidden "/Applications/Adobe InDesign CS6/Configuration" 97 | chflags hidden "/Applications/Adobe InDesign CS6/Documentation" 98 | chflags hidden "/Applications/Adobe InDesign CS6/Fonts" 99 | chflags hidden "/Applications/Adobe InDesign CS6/Legal" 100 | chflags hidden "/Applications/Adobe InDesign CS6/Plug-Ins" 101 | chflags hidden "/Applications/Adobe InDesign CS6/Presets" 102 | chflags hidden "/Applications/Adobe InDesign CS6/Scripts" 103 | chflags hidden "/Applications/Adobe InDesign CS6/Uninstall Adobe InDesign CS6" 104 | 105 | # Adobe Media Encoder CS6 106 | chflags hidden "/Applications/Adobe Media Encoder CS6/Configuration" 107 | 108 | # Adobe Photoshop CS6 109 | chflags hidden "/Applications/Adobe Photoshop CS6/Configuration" 110 | chflags hidden "/Applications/Adobe Photoshop CS6/Legal" 111 | chflags hidden "/Applications/Adobe Photoshop CS6/LegalNotices.pdf" 112 | chflags hidden "/Applications/Adobe Photoshop CS6/Locales" 113 | chflags hidden "/Applications/Adobe Photoshop CS6/Photoshop CS6 Read Me.pdf" 114 | chflags hidden "/Applications/Adobe Photoshop CS6/Plug-ins" 115 | chflags hidden "/Applications/Adobe Photoshop CS6/Presets" 116 | chflags hidden "/Applications/Adobe Photoshop CS6/Uninstall Adobe Photoshop CS6" 117 | 118 | # Adobe Prelude CS6 119 | chflags hidden "/Applications/Adobe Prelude CS6/Configuration" 120 | chflags hidden "/Applications/Adobe Prelude CS6/Uninstall Adobe Prelude CS6" 121 | 122 | # Adobe Premiere Pro CS6 123 | chflags hidden "/Applications/Adobe Premiere Pro CS6/Configuration" 124 | chflags hidden "/Applications/Adobe Premiere Pro CS6/Presets" 125 | chflags hidden "/Applications/Adobe Premiere Pro CS6/Uninstall Adobe Premiere Pro CS6" 126 | 127 | # Adobe SpeedGrade CS6 128 | chflags hidden "/Applications/Adobe SpeedGrade CS6/Uninstall Adobe SpeedGrade CS6" 129 | 130 | # Adobe Utilities folders 131 | # Adobe Application Manager 132 | chflags hidden "/Applications/Utilities/Adobe Application Manager" 133 | 134 | # Adobe Installers folder 135 | chflags hidden "/Applications/Utilities/Adobe Installers" 136 | 137 | # Adobe ExtendScript ToolKit 138 | chflags hidden "/Applications/Utilities/Adobe Utilities-CS6.localized/ExtendScript Toolkit CS6/ExtendScript Toolkit ReadMe.pdf" 139 | chflags hidden "/Applications/Utilities/Adobe Utilities-CS6.localized/ExtendScript Toolkit CS6/Legal" 140 | chflags hidden "/Applications/Utilities/Adobe Utilities-CS6.localized/ExtendScript Toolkit CS6/SDK" 141 | 142 | # Adobe Flash Player Install Manager 143 | chflags hidden "/Applications/Utilities/Adobe Flash Player Install Manager.app" 144 | 145 | echo "ADOBE CLEANUP COMPLETE" 146 | exit 0 147 | 148 | -------------------------------------------------------------------------------- /Adobe_CS6_MC_Cleanup/README.md: -------------------------------------------------------------------------------- 1 | This script can be used to clean up Adobe CS6 Master Collection installs for end user prettyfication. 2 | 3 | -------------------------------------------------------------------------------- /Autodesk_Installer_Scripts/Autodesk_AutoCAD_2015/scripts/postinstall: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # postinstall 4 | # AutoCAD PostInstall 5 | # Created by Stephen Warneford-Bygrave on 2016-06-17 6 | 7 | # Remove comment to enable debugging messages 8 | # DEBUG=1 9 | 10 | # Set variables 11 | pkgPath=$(dirname $0) 12 | pkgName="Install Autodesk AutoCAD 2015 for Mac.pkg" 13 | licenseType="N" 14 | serialNumber="" 15 | pKey="" 16 | networkServer="" 17 | tmpfile="/tmp/acodeAutoCAD2015" 18 | 19 | # Setup tmpfile 20 | echo "${serialNumber}">>$tmpfile 21 | echo "${pKey}">>$tmpfile 22 | if [[ "$licenseType" = "N" ]]; 23 | then 24 | echo "Single_License_Server">>$tmpfile 25 | echo "${networkServer}">>$tmpfile 26 | else 27 | echo "Standalone">>$tmpfile 28 | echo "-">>$tmpfile 29 | fi 30 | echo "US">>$tmpfile 31 | sudo chmod 777 $tmpfile 32 | 33 | # Run installer 34 | sudo installer -verboseR -pkg "$pkgPath"/"$pkgName" -target / 35 | 36 | exit 0 37 | -------------------------------------------------------------------------------- /Autodesk_Installer_Scripts/Autodesk_AutoCAD_2017/scripts/postinstall: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Author: Stephen Bygrave - Amsys 4 | # Name: postinstall (AutoCAD 2017) 5 | # 6 | # Purpose: AutoCAD 2017 Post-Install 7 | # Usage: Postinstall script in PKG 8 | # 9 | # Version 1.0.0, 2017-06-28 10 | # Initial Creation 11 | 12 | # Use at your own risk. Amsys will accept no responsibility for loss or damage 13 | # caused by this script. 14 | 15 | # If running natively as a script, Add "-d or --debug" at run time to enable 16 | # debugging messages. 17 | 18 | if [[ "${1}" == --debug || "${1}" == -d ]]; 19 | then 20 | set +x 21 | debug=1 22 | fi 23 | 24 | ##### Set variables 25 | 26 | logFile="/Library/Logs/Amsys-Installs.log" 27 | pkgPath="/tmp/AutoCAD 2017" 28 | pkgName="Install Autodesk AutoCAD 2017 for Mac.pkg" 29 | licenseType="N" 30 | serialNumber="562-78556198" 31 | pKey="777I1" 32 | networkServer="kms2.ad.mmu.ac.uk" 33 | tmpfile="/tmp/acodeAutoCAD2017" 34 | licPath="/Library/Application Support/Autodesk/CLM/LGS/${pKey}_2017.0.0.F" 35 | licFile="LICPATH.lic" 36 | lgsFile="LGS.data" 37 | 38 | ##### Declare functions 39 | 40 | writelog() 41 | { 42 | /bin/echo "$(/bin/date) ${1}" >> "${logFile}" 43 | /bin/echo "${1}" 44 | } 45 | 46 | 47 | echoVariables () 48 | { 49 | writelog "Log file is at ${logFile}" 50 | writelog "Path to Installer is ${pkgPath}" 51 | writelog "Installer name is ${pkgName}" 52 | writelog "License Type is ${licenseType}" 53 | #writelog "Serial number is ${serialNumber}" 54 | writelog "Product Key is ${pKey}" 55 | writelog "Network Server is ${networkServer}" 56 | writelog "Temp file is at ${tmpfile}" 57 | } 58 | 59 | setupTempFile () 60 | { 61 | writelog "" 62 | writelog "# Setting up License File..." 63 | /bin/echo "${serialNumber}" >> "${tmpfile}" 64 | /bin/echo "${pKey}" >> "${tmpfile}" 65 | if [[ "${licenseType}" == "N" ]]; 66 | then 67 | writelog "" 68 | writelog "# Network License detected" 69 | /bin/echo "Single_License_Server" >> "${tmpfile}" 70 | /bin/echo "${networkServer}" >> "${tmpfile}" 71 | else 72 | writelog "" 73 | writelog "# Standalone License detected" 74 | /bin/echo "Standalone" >> "${tmpfile}" 75 | /bin/echo "-" >> "${tmpfile}" 76 | fi 77 | /bin/echo "US" >> "${tmpfile}" 78 | /bin/chmod 777 "${tmpfile}" 79 | 80 | } 81 | 82 | runInstaller () 83 | { 84 | writelog "" 85 | writelog "# Installing AutoCAD 2017..." 86 | /usr/sbin/installer -verboseR -pkg "${pkgPath}/${pkgName}" -target / 87 | } 88 | 89 | createLicenseFiles () 90 | { 91 | writelog "" 92 | writelog "# Creating License File..." 93 | if [[ ! -e "${licPath}" ]]; 94 | then 95 | /bin/mkdir "${licPath}" 96 | fi 97 | /usr/bin/touch "${licPath}/${lgsFile}" 98 | /bin/chmod 777 "${licPath}/${lgsFile}" 99 | /usr/bin/touch "${licPath}/${licFile}" 100 | /bin/chmod 777 "${licPath}/${licFile}" 101 | if [[ "${licenseType}" == "N" ]]; 102 | then 103 | /bin/echo "SERVER ${networkServer} 000000000000" > "${licPath}/${licFile}" 104 | /bin/echo "USE_SERVER" >> "${licPath}/${licFile}" 105 | /bin/echo "_NETWORK" >> "${licPath}/${lgsFile}" 106 | else 107 | /bin/echo "_STANDALONE" >> "${licPath}/${lgsFile}" 108 | fi 109 | } 110 | 111 | cleanUp () 112 | { 113 | writelog "" 114 | writelog "# Cleaning up..." 115 | /bin/rm -rf "${pkgPath}" 116 | } 117 | 118 | ##### Run script 119 | 120 | if [[ ! -e "${logFile}" ]]; 121 | then 122 | /usr/bin/touch "${logFile}" 123 | fi 124 | 125 | if [[ ${debug} -eq 1 ]]; 126 | then 127 | writelog "" 128 | writelog "##### Debug Mode" 129 | writelog "" 130 | echoVariables 131 | fi 132 | 133 | writelog "" 134 | writelog "##### Starting AutoCAD 2017 Install..." 135 | writelog "" 136 | 137 | setupTempFile 138 | runInstaller 139 | createLicenseFiles 140 | cleanUp 141 | -------------------------------------------------------------------------------- /Autodesk_Installer_Scripts/Autodesk_Maya_2016/scripts/postinstall: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # postinstall 4 | # Maya PostInstall 5 | # Created by Stephen Warneford-Bygrave on 2016-06-17 6 | 7 | # Remove comment to enable debugging messages 8 | # DEBUG=1 9 | 10 | # Set variables 11 | pkgPath=$(dirname $0) 12 | setupPath="Install Maya 2016.app/Contents/MacOS/setup" 13 | logPath="/tmp/Maya_2016.log" 14 | serialNumber="" 15 | pKey="" 16 | licenseType="kNetwork" 17 | networkServer="" 18 | 19 | # Run installer 20 | "$pkgPath"/"$setupPath" --noui --log="$logPath" --force --serial_number="$serialNumber" --product_key="$pKey" --license_type="$licenseType" --server_name="$networkServer" 21 | 22 | exit 0 23 | -------------------------------------------------------------------------------- /Autodesk_Installer_Scripts/Autodesk_Maya_2017/scripts/postinstall: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Author: Stephen Bygrave - Amsys 4 | # Name: postinstall (Maya 2017) 5 | # 6 | # Purpose: Maya 2017 Post-Install 7 | # Usage: Postinstall script in PKG 8 | # 9 | # Version 1.0.0, 2017-06-28 10 | # Initial Creation 11 | 12 | # Use at your own risk. Amsys will accept no responsibility for loss or damage 13 | # caused by this script. 14 | 15 | # If running natively as a script, Add "-d or --debug" at run time to enable 16 | # debugging messages. 17 | 18 | if [[ "${1}" == --debug || "${1}" == -d ]]; 19 | then 20 | set +x 21 | debug=1 22 | fi 23 | 24 | ##### Set variables 25 | 26 | logFile="/Library/Logs/Amsys-Installs.log" 27 | pkgPath="/tmp/Maya 2017" 28 | setupPath="Install Maya 2017.app/Contents/MacOS/setup" 29 | licenseType="kNetwork" 30 | serialNumber="XXX-XXXXXXXX" 31 | pKey="657I1" 32 | networkServer="xxx.xxx.xxx.xxx" 33 | licPath="/Library/Application Support/Autodesk/CLM/LGS/${pKey}_2017.0.0.F" 34 | licFile="LICPATH.lic" 35 | lgsFile="LGS.data" 36 | 37 | ##### Declare functions 38 | 39 | writelog() 40 | { 41 | /bin/echo "$(/bin/date) ${1}" >> "${logFile}" 42 | /bin/echo "${1}" 43 | } 44 | 45 | 46 | echoVariables () 47 | { 48 | writelog "Log file is at ${logFile}" 49 | writelog "Path to Installer is ${pkgPath}" 50 | writelog "Installer name is ${setupPath}" 51 | writelog "License Type is ${licenseType}" 52 | #writelog "Serial number is ${serialNumber}" 53 | writelog "Product Key is ${pKey}" 54 | writelog "Network Server is ${networkServer}" 55 | writelog "License File is ${licFile}" 56 | writelog "LGS file is ${lgsFile}" 57 | } 58 | 59 | runInstaller () 60 | { 61 | writelog "" 62 | writelog "# Installing Maya 2017..." 63 | "${pkgPath}/${setupPath}" --noui --log="${logFile}" --force --serial_number="${serialNumber}" --product_key="${pKey}" --license_type="${licenseType}" --server_name="${networkServer}" 64 | } 65 | 66 | createLicenseFiles () 67 | { 68 | writelog "" 69 | writelog "# Creating License File..." 70 | if [[ ! -e "${licPath}" ]]; 71 | then 72 | /bin/mkdir "${licPath}" 73 | fi 74 | /usr/bin/touch "${licPath}/${lgsFile}" 75 | /bin/chmod 777 "${licPath}/${lgsFile}" 76 | /usr/bin/touch "${licPath}/${licFile}" 77 | /bin/chmod 777 "${licPath}/${licFile}" 78 | if [[ "${licenseType}" == "kNetwork" ]]; 79 | then 80 | /bin/echo "SERVER ${networkServer} 000000000000" > "${licPath}/${licFile}" 81 | /bin/echo "USE_SERVER" >> "${licPath}/${licFile}" 82 | /bin/echo "_NETWORK" >> "${licPath}/${lgsFile}" 83 | else 84 | /bin/echo "_STANDALONE" >> "${licPath}/${lgsFile}" 85 | fi 86 | } 87 | 88 | cleanUp () 89 | { 90 | writelog "" 91 | writelog "# Cleaning up..." 92 | /bin/rm -rf "${pkgPath}" 93 | } 94 | 95 | ##### Run script 96 | 97 | if [[ ! -e "${logFile}" ]]; 98 | then 99 | /usr/bin/touch "${logFile}" 100 | fi 101 | 102 | if [[ ${debug} -eq 1 ]]; 103 | then 104 | writelog "" 105 | writelog "##### Debug Mode" 106 | writelog "" 107 | echoVariables 108 | fi 109 | 110 | writelog "" 111 | writelog "##### Starting Maya 2017 Install..." 112 | writelog "" 113 | 114 | runInstaller 115 | createLicenseFiles 116 | cleanUp 117 | -------------------------------------------------------------------------------- /Autodesk_Installer_Scripts/Autodesk_Maya_2018/scripts/install_and_activate_maya_2018_single.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Author: David Acland - Moof IT 4 | # Name: postinstall (Maya 2018) 5 | # Full blog article relating to this script can be found here: https://www.moof-it.co.uk/technical/deploying-autodesk-maya-2018-with-jamf-pro 6 | # 7 | # Purpose: Maya 2018 Post-Install 8 | # Installs and activates Autodesk Maya 2018 with a standalone license key 9 | # 10 | # Usage: Postinstall script in PKG 11 | # Replace XXX-XXXXXXXX with your license code on line 20 12 | # 13 | # Version 1.0.0, 2018-02-18 14 | # Initial Creation 15 | # 16 | # Use at your own risk. Amsys will accept no responsibility for loss or damage 17 | # caused by this script. 18 | 19 | /tmp/Install\ Maya\ 2018.app/Contents/MacOS/setup --noui 20 | 21 | /private/tmp/Install\ Maya\ 2018.app/Contents/Resources/adlmreg -i S 657J1 657J1 2018.0.0.F XXX-XXXXXXXX /Library/Application\ Support/Autodesk/Adlm/PIT/2018/MayaConfig.pit 22 | 23 | mkdir /Library/Application\ Support/Autodesk/CLM/LGS/657J1_2018.0.0.F 24 | touch /Library/Application\ Support/Autodesk/CLM/LGS/657J1_2018.0.0.F/LGS.data 25 | chmod 777 /Library/Application\ Support/Autodesk/CLM/LGS/657J1_2018.0.0.F/LGS.data 26 | echo "_STANDALONE" >> /Library/Application\ Support/Autodesk/CLM/LGS/657J1_2018.0.0.F/LGS.data 27 | -------------------------------------------------------------------------------- /Autodesk_Installer_Scripts/Autodesk_Mudbox_2016/scripts/postinstall: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # postinstall 4 | # Mudbox postinstall 5 | # created by stephen warneford-bygrave on 2016-06-17 6 | 7 | # remove comment to enable debugging messages 8 | # debug=1 9 | 10 | # set variables 11 | pkgPath=$(dirname $0) 12 | setupPath="Install Mudbox 2016.app/Contents/MacOS/setup" 13 | adlmregPath="Install Mudbox 2016.app/Contents/Resources/adlmreg" 14 | logPath="/var/log/mudbox2016install.log" 15 | serialNumber="" 16 | pKey="" 17 | licenseType="Network" 18 | networkServer="" 19 | mudBoxLicence="/private/var/flexlm/Mudbox2016.lic" 20 | 21 | # Run installer 22 | "$pkgPath"/"$setupPath" --noui --log="$logPath" --force --serial_number="$serialNumber" --product_key="$pKey" --license_type="$licenseType" --server_name="$networkServer" 23 | 24 | # Create license file 25 | mkdir /private/var/flexlm 26 | touch "$mudBoxLicence" 27 | 28 | echo "SERVER $networkServer 0" > "$mudBoxLicence" 29 | echo "USE_SERVER" >> "$mudBoxLicence" 30 | 31 | chmod 744 "$mudBoxLicence" 32 | 33 | # Register correctly 34 | "$adlmregPath" -i N 498H1 "$pKey" 2016.0.0.F "$serialNumber" "/Library/Application Support/Autodesk/Adlm/PIT/2016/MudboxConfig.pit" 35 | 36 | exit 0 37 | -------------------------------------------------------------------------------- /Autodesk_Installer_Scripts/Autodesk_Mudbox_2017/scripts/postinstall: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Author: Stephen Bygrave - Amsys 4 | # Name: postinstall (Mudbox 2017) 5 | # 6 | # Purpose: Mudbox 2017 Post-Install 7 | # Usage: Postinstall script in PKG 8 | # 9 | # Version 1.0.0, 2017-06-28 10 | # Initial Creation 11 | 12 | # Use at your own risk. Amsys will accept no responsibility for loss or damage 13 | # caused by this script. 14 | 15 | # If running natively as a script, Add "-d or --debug" at run time to enable 16 | # debugging messages. 17 | 18 | if [[ "${1}" == --debug || "${1}" == -d ]]; 19 | then 20 | set +x 21 | debug=1 22 | fi 23 | 24 | ##### Set variables 25 | 26 | logFile="/Library/Logs/Amsys-Installs.log" 27 | pkgPath="/tmp/Mudbox 2017" 28 | setupPath="Install Mudbox 2017.app/Contents/MacOS/setup" 29 | licenseType="kNetwork" 30 | serialNumber="561-59172657" 31 | pKey="498I1" 32 | networkServer="kms2.ad.mmu.ac.uk" 33 | licPath="/Library/Application Support/Autodesk/CLM/LGS/${pKey}_2017.0.0.F" 34 | licFile="LICPATH.lic" 35 | lgsFile="LGS.data" 36 | 37 | ##### Declare functions 38 | 39 | writelog() 40 | { 41 | /bin/echo "$(/bin/date) ${1}" >> "${logFile}" 42 | /bin/echo "${1}" 43 | } 44 | 45 | 46 | echoVariables () 47 | { 48 | writelog "Log file is at ${logFile}" 49 | writelog "Path to Installer is ${pkgPath}" 50 | writelog "Installer name is ${setupPath}" 51 | writelog "License Type is ${licenseType}" 52 | #writelog "Serial number is ${serialNumber}" 53 | writelog "Product Key is ${pKey}" 54 | writelog "Network Server is ${networkServer}" 55 | writelog "License File is ${licFile}" 56 | writelog "LGS file is ${lgsFile}" 57 | } 58 | 59 | runInstaller () 60 | { 61 | writelog "" 62 | writelog "# Installing Mudbox 2017..." 63 | "${pkgPath}/${setupPath}" --noui --log="${logFile}" --force --serial_number="${serialNumber}" --product_key="${pKey}" --license_type="${licenseType}" --server_name="${networkServer}" 64 | } 65 | 66 | createLicenseFiles () 67 | { 68 | writelog "" 69 | writelog "# Creating License File..." 70 | if [[ ! -e "${licPath}" ]]; 71 | then 72 | /bin/mkdir "${licPath}" 73 | fi 74 | /usr/bin/touch "${licPath}/${lgsFile}" 75 | /bin/chmod 777 "${licPath}/${lgsFile}" 76 | /usr/bin/touch "${licPath}/${licFile}" 77 | /bin/chmod 777 "${licPath}/${licFile}" 78 | if [[ "${licenseType}" == "kNetwork" ]]; 79 | then 80 | /bin/echo "SERVER ${networkServer} 000000000000" > "${licPath}/${licFile}" 81 | /bin/echo "USE_SERVER" >> "${licPath}/${licFile}" 82 | /bin/echo "_NETWORK" >> "${licPath}/${lgsFile}" 83 | else 84 | /bin/echo "_STANDALONE" >> "${licPath}/${lgsFile}" 85 | fi 86 | } 87 | 88 | cleanUp () 89 | { 90 | writelog "" 91 | writelog "# Cleaning up..." 92 | /bin/rm -rf "${pkgPath}" 93 | } 94 | 95 | ##### Run script 96 | 97 | if [[ ! -e "${logFile}" ]]; 98 | then 99 | /usr/bin/touch "${logFile}" 100 | fi 101 | 102 | if [[ ${debug} -eq 1 ]]; 103 | then 104 | writelog "" 105 | writelog "##### Debug Mode" 106 | writelog "" 107 | echoVariables 108 | fi 109 | 110 | writelog "" 111 | writelog "##### Starting Mudbox 2017 Install..." 112 | writelog "" 113 | 114 | runInstaller 115 | createLicenseFiles 116 | cleanUp 117 | -------------------------------------------------------------------------------- /Autodesk_Installer_Scripts/Autodesk_Sketchbook_Pro_2016/scripts/postinstall: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # postinstall 4 | # Sketchbook Pro PostInstall 5 | # Created by Stephen Warneford-Bygrave on 2016-06-17 6 | 7 | # Remove comment to enable debugging messages 8 | # DEBUG=1 9 | 10 | # Set variables 11 | pkgPath=$(dirname $0) 12 | pkgName="Autodesk_SketchBook_Pro_2016R1_Multilingual_MAC_OSX.pkg" 13 | logPath="/var/log/sketchup2016install.log" 14 | serialNumber="" 15 | pKey="" 16 | licenseType="Network" 17 | networkServer="" 18 | 19 | # Create license file 20 | mkdir /private/var/flexlm 21 | touch /private/var/flexlm/SketchBookPro2016.lic 22 | 23 | echo "SERVER $networkServer 0" > /private/var/flexlm/SketchBookPro2016.lic 24 | echo "USE_SERVER" >> /private/var/flexlm/SketchBookPro2016.lic 25 | 26 | chmod 744 /private/var/flexlm/SketchBookPro2016.lic 27 | 28 | mkdir /private/var/tmp/pcw 29 | touch /private/var/tmp/pcw/adlminfo 30 | 31 | echo "type=$licenseType" > /private/var/tmp/pcw/adlminfo 32 | echo "serial=$serialNumber" >> /private/var/tmp/pcw/adlminfo 33 | echo "prodkey=$pKey" >> /private/var/tmp/pcw/adlminfo 34 | echo "configuration=" >> /private/var/tmp/pcw/adlminfo 35 | echo "" >> /private/var/tmp/pcw/adlminfo 36 | echo "LicenseMode=0" >> /private/var/tmp/pcw/adlminfo 37 | echo "SerialNumber=$serialNumber" >> /private/var/tmp/pcw/adlminfo 38 | echo "ProductCode=$pKey" >> /private/var/tmp/pcw/adlminfo 39 | echo "lic_path=/var/flexlm/SketchBookPro2016.lic" >> /private/var/tmp/pcw/adlminfo 40 | echo "sb_path=/Library/Preferences/com.autodesk.SketchBookPro2016.adlminfo.txt" >> /private/var/tmp/pcw/adlminfo 41 | echo "installed_path=/Applications/Autodesk/SketchBook Pro 2016" >> /private/var/tmp/pcw/adlminfo 42 | 43 | # Run installer 44 | installer -pkg "$pkgPath"/"$pkgName" -target / 45 | 46 | exit 0 47 | -------------------------------------------------------------------------------- /Autodesk_Installer_Scripts/Autodesk_Sketchbook_Pro_2018/scripts/postinstall: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Author: Stephen Bygrave - Amsys 4 | # Name: postinstall (Maya 2017) 5 | # 6 | # Purpose: Sketchbook 2018 Post-Install 7 | # Usage: Postinstall script in PKG 8 | # 9 | # Version 1.0.0, 2017-06-28 10 | # Initial Creation 11 | 12 | # Use at your own risk. Amsys will accept no responsibility for loss or damage 13 | # caused by this script. 14 | 15 | # If running natively as a script, Add "-d or --debug" at run time to enable 16 | # debugging messages. 17 | 18 | if [[ "${1}" == --debug || "${1}" == -d ]]; 19 | then 20 | set +x 21 | debug=1 22 | fi 23 | 24 | ##### Set variables 25 | logFile="/Library/Logs/Amsys-Installs.log" 26 | pkgPath="/tmp/SketchBook 2018" 27 | pkgName="Autodesk_SketchBook_for_Enterprise_2018_Multilingual_MAC_OSX.pkg" 28 | serialNumber="562-44003414" 29 | pKey="871J1" 30 | licenseType="Network" 31 | networkServer="kms2.ad.mmu.ac.uk" 32 | licPath="/Library/Application Support/Autodesk/CLM/LGS/${pKey}_2018.0.0.F" 33 | licFile="LICPATH.lic" 34 | lgsFile="LGS.data" 35 | 36 | ##### Declare functions 37 | 38 | writelog() 39 | { 40 | /bin/echo "$(/bin/date) ${1}" >> "${logFile}" 41 | /bin/echo "${1}" 42 | } 43 | 44 | 45 | echoVariables () 46 | { 47 | writelog "Log file is at ${logFile}" 48 | writelog "Path to Installer is ${pkgPath}" 49 | writelog "Installer name is ${setupPath}" 50 | writelog "License Type is ${licenseType}" 51 | #writelog "Serial number is ${serialNumber}" 52 | writelog "Product Key is ${pKey}" 53 | writelog "Network Server is ${networkServer}" 54 | writelog "License File is ${licFile}" 55 | writelog "LGS file is ${lgsFile}" 56 | } 57 | 58 | runInstaller () 59 | { 60 | writelog "" 61 | writelog "# Installing SketchBook 2018..." 62 | installer -pkg "${pkgPath}/${pkgName}" -target / 63 | } 64 | 65 | createLicenseFiles () 66 | { 67 | writelog "" 68 | writelog "# Creating License File..." 69 | if [[ ! -e "${licPath}" ]]; 70 | then 71 | /bin/mkdir "${licPath}" 72 | fi 73 | /usr/bin/touch "${licPath}/${lgsFile}" 74 | /bin/chmod 777 "${licPath}/${lgsFile}" 75 | /usr/bin/touch "${licPath}/${licFile}" 76 | /bin/chmod 777 "${licPath}/${licFile}" 77 | if [[ "${licenseType}" == "Network" ]]; 78 | then 79 | /bin/echo "SERVER ${networkServer} 000000000000" > "${licPath}/${licFile}" 80 | /bin/echo "USE_SERVER" >> "${licPath}/${licFile}" 81 | /bin/echo "_NETWORK" >> "${licPath}/${lgsFile}" 82 | else 83 | /bin/echo "_STANDALONE" >> "${licPath}/${lgsFile}" 84 | fi 85 | } 86 | 87 | cleanUp () 88 | { 89 | writelog "" 90 | writelog "# Cleaning up..." 91 | /bin/rm -rf "${pkgPath}" 92 | } 93 | 94 | ##### Run script 95 | 96 | if [[ ! -e "${logFile}" ]]; 97 | then 98 | /usr/bin/touch "${logFile}" 99 | fi 100 | 101 | if [[ ${debug} -eq 1 ]]; 102 | then 103 | writelog "" 104 | writelog "##### Debug Mode" 105 | writelog "" 106 | echoVariables 107 | fi 108 | 109 | writelog "" 110 | writelog "##### Starting SketchBook 2018 Install..." 111 | writelog "" 112 | 113 | runInstaller 114 | createLicenseFiles 115 | cleanUp 116 | -------------------------------------------------------------------------------- /FileZilla/Filezilla - Suppress first run per user.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # DW - Amsys - 2016.09.14 4 | # Will deploy do not show first run setting for Filezilla into the User's Library as required 5 | # 6 | 7 | username="$3" 8 | if [ -z "$username" ] || [[ "$username" == "root" ]]; then # Checks if the variable is empty (user running script from Self Service) 9 | username=$(python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");') 10 | fi 11 | echo "Logging in user: $username" 12 | 13 | PathForDirectory="/Users/$username/.config/filezilla" 14 | PathForFile="${PathForDirectory}/filezilla.xml" 15 | 16 | mkdir -p "$PathForDirectory" 17 | 18 | echo "" > "$PathForFile" 19 | echo "" >> "$PathForFile" 20 | echo " " >> "$PathForFile" 21 | echo " 1" >> "$PathForFile" 22 | echo " 7" >> "$PathForFile" 23 | echo " 2019-08-31 13:19:22" >> "$PathForFile" 24 | echo " 0" >> "$PathForFile" 25 | echo " " >> "$PathForFile" 26 | echo "" >> "$PathForFile" 27 | 28 | chown -R "$username" "/Users/$username/.config" 29 | 30 | exit 0 31 | -------------------------------------------------------------------------------- /FxFactory/FxFactory Helper Tool installer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ######################################################################################### 4 | # Author: Darren Wallace - Amsys 5 | # Name: FxFactory - Helper Tool installer 6 | # 7 | # Purpose: This script will complete the helper tool installation to stop the first run 8 | # admin authentication request 9 | # Usage: Jamf Pro 10 | # 11 | # Version 2017.07.04 - DW - Initial Creation 12 | # 13 | ######################################################################################### 14 | # 15 | # Copyright (c) 2017, Amsys Ltd. All rights reserved. 16 | # 17 | # Redistribution and use in source and binary forms, with or without 18 | # modification, are permitted provided that the following conditions are met: 19 | # * Redistributions of source code must retain the above copyright 20 | # notice, this list of conditions and the following disclaimer. 21 | # * Redistributions in binary form must reproduce the above copyright 22 | # notice, this list of conditions and the following disclaimer in the 23 | # documentation and/or other materials provided with the distribution. 24 | # * Neither Amsys Ltd nor the 25 | # names of its contributors may be used to endorse or promote products 26 | # derived from this software without specific prior written permission. 27 | # 28 | # THIS SOFTWARE IS PROVIDED BY Amsys LTD "AS IS" AND ANY 29 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | # DISCLAIMED. IN NO EVENT SHALL Amsys LTD BE LIABLE FOR ANY 32 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 33 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 35 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 36 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 37 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | # 39 | ######################################################################################### 40 | # 41 | # SUPPORT FOR THIS PROGRAM 42 | # 43 | # This program is distributed "as is" by Amsys LTD. 44 | # For more information or support, please utilise the following resources: 45 | # 46 | # http://www.amsys.co.uk 47 | # 48 | ######################################################################################### 49 | 50 | ##################################### Set variables ##################################### 51 | 52 | # Name of the script 53 | scriptName="FxFactory - Helper Tool installer" 54 | # Location of the LogFile to save output to 55 | logFile="/Library/Logs/${scriptName}" 56 | # Helper Directory 57 | helperDir="/Library/PrivilegedHelperTools" 58 | # Helper tool source location 59 | helperSource="/Applications/FxFactory.app/Contents/Library/LaunchServices/com.fxfactory.FxFactory.helper" 60 | # Helper tool destination location 61 | helperDest="${helperDir}/com.fxfactory.FxFactory.helper" 62 | # Launch Daemon for the Helper Tool 63 | helperLaunchDaemon="/Library/LaunchDaemons/com.fxfactory.FxFactory.helper.plist" 64 | 65 | 66 | ################################## Declare functions #################################### 67 | 68 | echoVariables () 69 | { 70 | echo "${}" 71 | } 72 | 73 | # Function to write input to the terminal and a logfile 74 | writelog () 75 | { 76 | echo "$(date) - ${1}" 77 | echo "$(date) - ${1}" >> "${logFile}" 78 | } 79 | 80 | # Function to check and create Helper Tool Directory 81 | checkHelperDir () 82 | { 83 | if [[ -d "${helperDir}" ]]; 84 | then 85 | writelog "Helper Directory present at ${helperDir}" 86 | else 87 | mkdir "${helperDir}" 88 | chown root:wheel "${helperDir}" 89 | chmod 755 "${helperDir}" 90 | writelog "Helper Directory NOT present but created at ${helperDir}" 91 | fi 92 | } 93 | 94 | # Function to copy over and permission Helper Tool 95 | copyHelperTool () 96 | { 97 | /bin/cp -f "${helperSource}" "${helperDest}" 98 | /usr/sbin/chown root:wheel "${helperDest}" 99 | /bin/chmod 544 "${helperDest}" 100 | writelog "Helper Tool copied over to ${helperDest}" 101 | } 102 | 103 | # Create Launch Daemon for the helper tool 104 | createLaunchDaemon () 105 | { 106 | rm "${helperLaunchDaemon}" 107 | /usr/libexec/PlistBuddy -c "Add Label string" "${helperLaunchDaemon}" 108 | /usr/libexec/PlistBuddy -c "Set Label com.fxfactory.FxFactory.helper" "${helperLaunchDaemon}" 109 | /usr/libexec/PlistBuddy -c "Add MachServices dict" "${helperLaunchDaemon}" 110 | /usr/libexec/PlistBuddy -c "Add MachServices:com.fxfactory.FxFactory.helper bool" "${helperLaunchDaemon}" 111 | /usr/libexec/PlistBuddy -c "Set MachServices:com.fxfactory.FxFactory.helper true" "${helperLaunchDaemon}" 112 | /usr/libexec/PlistBuddy -c "Add ProgramArguments array" "${helperLaunchDaemon}" 113 | /usr/libexec/PlistBuddy -c "Add ProgramArguments:0 string" "${helperLaunchDaemon}" 114 | /usr/libexec/PlistBuddy -c "Set ProgramArguments:0 ${helperDest}" "${helperLaunchDaemon}" 115 | /bin/launchctl load "${helperLaunchDaemon}" 116 | writelog "LaunchDaemon created and loaded at ${helperLaunchDaemon}" 117 | } 118 | 119 | ##################################### Debug Setup ####################################### 120 | 121 | # If running natively as a script, Add "-d or --debug" at run time to enable 122 | # debugging messages. If running from Casper, set the variable $9 to "Yes". 123 | if [[ "${1}" == --debug || "${1}" == -d || "${9}" == [Yy] || "${9}" == [Yy]es ]]; 124 | then 125 | echo "" 126 | echo "##### Using Debug mode" 127 | echo "" 128 | set +x 129 | debug=1 130 | fi 131 | 132 | ### Debug Setup 133 | if [[ ${debug} -eq 1 ]]; 134 | then 135 | echoVariables 136 | fi 137 | 138 | ##################################### Run Script ####################################### 139 | 140 | # Check and create Helper Tool Directory if required 141 | checkHelperDir 142 | # Copy over and permission Helper Tool 143 | copyHelperTool 144 | # Create and load Launch Daemon 145 | createLaunchDaemon 146 | 147 | exit -------------------------------------------------------------------------------- /Google_Chrome_Setup/Google Chrome Master Preferences: -------------------------------------------------------------------------------- 1 | { 2 | homepage : "http://www.google.co.uk", 3 | homepage_is_newtabpage : false, 4 | first_run_tabs: [ "http://www.google.co.uk" ], 5 | homepage: "http://www.google.co.uk", 6 | browser : { 7 | show_home_button: true, 8 | show_update_promotion_info_bar: false, 9 | check_default_browser: false 10 | }, 11 | distribution : { 12 | show_welcome_page : false, 13 | skip_first_run_ui : true, 14 | import_history : false, 15 | import_bookmarks : false, 16 | import_home_page : false, 17 | import_search_engine : false, 18 | suppress_first_run_bubble: true, 19 | .ApacheDirectoryStudio/make_chrome_default: false, 20 | suppress_first_run_default_browser_prompt: true 21 | }, 22 | sync_promo : { 23 | user_skipped : true 24 | }, 25 | .ApacheDirectoryStudio/proxy: { 26 | bypass_list: , 27 | mode: system, 28 | server: 29 | }, 30 | sync_promo: { 31 | user_skipped: true 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Google_Chrome_Setup/Google Chrome Setup Script.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Created by Amsys 4 | # 5 | # Use at your own risk. Amsys will accept 6 | # no responsibility for loss or damage 7 | # caused by this script. 8 | # DW - Amsys - 2016.01.25 9 | 10 | # Name the Casper Parameters: 11 | # 4 URL to set homepage to 12 | # 5 behaviour to adopt if preference file exists (UPDATE, UPDATEONCE, SKIP) 13 | 14 | # Script setup ######################################## 15 | # Importing Libraries 16 | import json 17 | import sys 18 | from SystemConfiguration import SCDynamicStoreCopyConsoleUser 19 | import os 20 | import subprocess 21 | 22 | print("STARTING: Google Chrome Setup Script") 23 | username = "" 24 | homepage = "" 25 | behaviour = "" 26 | 27 | # Variables 28 | try: 29 | username = sys.argv[3] 30 | homepage = sys.argv[4] 31 | behaviour = sys.argv[5] 32 | except: 33 | pass 34 | 35 | # Checks if the variable is empty (user running script from Self Service) 36 | if len(username) < 1: 37 | username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n") 38 | 39 | # Work out the user's home folder location 40 | userhome = os.path.expanduser("~" + username) 41 | if len(userhome) < 1: 42 | print("User Home not successfully discovered") 43 | exit(1) 44 | 45 | # Checks if the variable is empty (user running script from Self Service) 46 | if len(homepage) < 1: 47 | url_address = "http://www.google.co.uk" 48 | else: 49 | url_address = homepage 50 | 51 | if len(behaviour) < 1: 52 | behaviour = "SKIP" 53 | 54 | firstrundirectory = userhome + "/Library/Application Support/Google/Chrome" 55 | firstrunfile = userhome + "/Library/Application Support/Google/Chrome/First Run" 56 | firstruntopdirectory = userhome + "/Library/Application Support/Google" 57 | preferencesdirectory = userhome + "/Library/Application Support/Google/Chrome/Default" 58 | preferencesfile = userhome + "/Library/Application Support/Google/Chrome/Default/Preferences" 59 | runoncefile = userhome + "/Library/Application Support/Google/Chrome/Default/PreferencesSetOnce" 60 | 61 | # Print out found variables 62 | print("Username: " + username) 63 | print("Homepage: " + url_address) 64 | print("Behaviour: " + behaviour) 65 | print("Userhome: " + userhome) 66 | 67 | # First Run file creation ######################## 68 | 69 | # Check if first run directory exists and create it if needed 70 | if not os.path.exists(firstrundirectory): 71 | os.makedirs(firstrundirectory) 72 | 73 | # Try and create the first run file 74 | try: 75 | open(firstrunfile, 'a').close() 76 | except: 77 | print("Failed to create first run file") 78 | exit(2) 79 | 80 | # Fix any permissions with this bit 81 | try: 82 | subprocess.call(['chown', '-R', username, firstruntopdirectory]) 83 | except: 84 | print("Failed to permission the first run file directory") 85 | exit(3) 86 | 87 | # Preference file creation ######################## 88 | 89 | # Create the Preference file directory 90 | if not os.path.exists(preferencesdirectory): 91 | try: 92 | os.makedirs(preferencesdirectory) 93 | except: 94 | print("Failed to create User's Preference file directory") 95 | exit(4) 96 | 97 | if os.path.isfile(preferencesfile): 98 | if behaviour.upper() == "SKIP": 99 | print("Preference file exists and script is set to skip") 100 | exit(0) 101 | elif behaviour.upper() == "UPDATEONCE": 102 | if os.path.isfile(runoncefile): 103 | print("Preference file exists and has been updated once already") 104 | exit(0) 105 | else: 106 | open(runoncefile, 'a').close() 107 | elif behaviour.upper() == "UPDATE": 108 | print("Preference file exists and script is set to update, continuing...") 109 | else: 110 | try: 111 | open(preferencesfile, 'a').close() 112 | # os.system("echo " + "{}" ">" + preferencesfile) 113 | except: 114 | print("Failed to create the preference file") 115 | exit(5) 116 | 117 | print("Writing content to preference file") 118 | 119 | # Read the file 120 | with open(preferencesfile) as json_file: 121 | try: 122 | json_decoded = json.load(json_file) 123 | except ValueError: 124 | json_decoded = {} 125 | 126 | # Set the Values 127 | # browser section 128 | json_decoded["browser"] = {} 129 | json_decoded["browser"]["check_default_browser"] = False 130 | json_decoded["browser"]["show_home_button"] = True 131 | json_decoded["browser"]["show_update_promotion_info_bar"] = False 132 | 133 | # distribution section 134 | json_decoded["distribution"] = {} 135 | json_decoded["distribution"]["import_bookmarks"] = False 136 | json_decoded["distribution"]["import_history"] = False 137 | json_decoded["distribution"]["import_home_page"] = False 138 | json_decoded["distribution"]["import_search_engine"] = False 139 | json_decoded["distribution"]["make_chrome_default"] = False 140 | json_decoded["distribution"]["show_welcome_page"] = False 141 | json_decoded["distribution"]["skip_first_run_ui"] = True 142 | json_decoded["distribution"]["suppress_first_run_bubble"] = True 143 | json_decoded["distribution"]["suppress_first_run_default_browser_prompt"] = True 144 | 145 | # top level section 146 | json_decoded["first_run_tabs"] = {} 147 | json_decoded["first_run_tabs"] = url_address 148 | json_decoded["homepage"] = url_address 149 | json_decoded["homepage_is_newtabpage"] = False 150 | 151 | # Proxy section 152 | json_decoded["proxy"] = {} 153 | json_decoded["proxy"]["bypass_list"] = "" 154 | json_decoded["proxy"]["mode"] = "system" 155 | json_decoded["proxy"]["server"] = "" 156 | 157 | # sync_promo section 158 | json_decoded["sync_promo"] = {} 159 | json_decoded["sync_promo"]["user_skipped"] = True 160 | 161 | # session section 162 | json_decoded["session"] = {} 163 | json_decoded["session"]["restore_on_startup"] = 4 164 | json_decoded["session"]["startup_urls"] = [url_address] 165 | 166 | # Save changes 167 | with open(preferencesfile, 'w+') as json_file: 168 | json.dump(json_decoded, json_file) 169 | 170 | # Re-permission directories 171 | try: 172 | subprocess.call(['chown', '-R', username, preferencesdirectory]) 173 | except: 174 | print("Failed to permission the preference file directory") 175 | exit(6) 176 | 177 | print("Script Completed") 178 | exit(0) 179 | -------------------------------------------------------------------------------- /Google_Chrome_Setup/chrome-enable-autoupdates.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # encoding: utf-8 3 | """ 4 | chrome-enable-autoupdates.py 5 | 6 | This script enables system wide automatic updates for Google Chrome. 7 | It should work for Chrome versions 18 and later. No configuration needed 8 | as this is originally intended as a munki postinstall script. 9 | 10 | Created by Hannes Juutilainen, hjuutilainen@mac.com 11 | 12 | History: 13 | 2015-09-25, Niklas Blomdalen 14 | - Modifications to include old KeystoneRegistration installation (python version) 15 | 2014-11-20, Hannes Juutilainen 16 | - Modifications for Chrome 39 17 | 2012-08-31, Hannes Juutilainen 18 | - Added --force flag to keystoneInstall as suggested by Riley Shott 19 | 2012-05-29, Hannes Juutilainen 20 | - Added more error checking 21 | 2012-05-25, Hannes Juutilainen 22 | - Added some error checking in main 23 | 2012-05-24, Hannes Juutilainen 24 | - First version 25 | """ 26 | 27 | import sys 28 | import os 29 | import getopt 30 | import subprocess 31 | import plistlib 32 | 33 | chromePath = "/Applications/Google Chrome.app" 34 | infoPlistPath = os.path.realpath(os.path.join(chromePath, 'Contents/Info.plist')) 35 | brandPath = "/Library/Google/Google Chrome Brand.plist" 36 | brandKey = "KSBrandID" 37 | tagPath = infoPlistPath 38 | tagKey = "KSChannelID" 39 | versionPath = infoPlistPath 40 | versionKey = "KSVersion" 41 | 42 | 43 | class Usage(Exception): 44 | def __init__(self, msg): 45 | self.msg = msg 46 | 47 | 48 | def chromeIsInstalled(): 49 | """Check if Chrome is installed""" 50 | if os.path.exists(chromePath): 51 | return True 52 | else: 53 | return False 54 | 55 | 56 | def chromeVersion(): 57 | """Returns Chrome version""" 58 | infoPlist = plistlib.readPlist(infoPlistPath) 59 | bundleShortVersion = infoPlist["CFBundleShortVersionString"] 60 | return bundleShortVersion 61 | 62 | 63 | def chromeKSUpdateURL(): 64 | """Returns KSUpdateURL from Chrome Info.plist""" 65 | infoPlist = plistlib.readPlist(infoPlistPath) 66 | KSUpdateURL = infoPlist["KSUpdateURL"] 67 | return KSUpdateURL 68 | 69 | 70 | def chromeKSProductID(): 71 | """Returns KSProductID from Chrome Info.plist""" 72 | infoPlist = plistlib.readPlist(infoPlistPath) 73 | KSProductID = infoPlist["KSProductID"] 74 | return KSProductID 75 | 76 | 77 | def keystoneRegistrationFrameworkPath(): 78 | """Returns KeystoneRegistration.framework path""" 79 | keystoneRegistration = os.path.join(chromePath, 'Contents/Versions') 80 | keystoneRegistration = os.path.join(keystoneRegistration, chromeVersion()) 81 | keystoneRegistration = os.path.join(keystoneRegistration, 'Google Chrome Framework.framework') 82 | keystoneRegistration = os.path.join(keystoneRegistration, 'Frameworks/KeystoneRegistration.framework') 83 | return keystoneRegistration 84 | 85 | 86 | def keystoneInstall(): 87 | """Install the current Keystone""" 88 | installScript = os.path.join(keystoneRegistrationFrameworkPath(), 'Resources/ksinstall') 89 | if not os.path.exists(installScript): 90 | installScript = os.path.join(keystoneRegistrationFrameworkPath(), 'Resources/install.py') 91 | keystonePayload = os.path.join(keystoneRegistrationFrameworkPath(), 'Resources/Keystone.tbz') 92 | if os.path.exists(installScript) and os.path.exists(keystonePayload): 93 | retcode = subprocess.call([installScript, '--install', keystonePayload, '--force']) 94 | if retcode == 0: 95 | return True 96 | else: 97 | return False 98 | else: 99 | print >> sys.stderr, "Error: KeystoneRegistration.framework not found" 100 | return False 101 | 102 | 103 | def removeChromeFromKeystone(): 104 | """Removes Chrome from Keystone""" 105 | ksadmin = "/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/MacOS/ksadmin" 106 | ksadminProcess = [ ksadmin, '--delete', '--productid', chromeKSProductID()] 107 | retcode = subprocess.call(ksadminProcess) 108 | if retcode == 0: 109 | return True 110 | else: 111 | return False 112 | 113 | 114 | def registerChromeWithKeystone(): 115 | """Registers Chrome with Keystone""" 116 | ksadmin = "/Library/Google/GoogleSoftwareUpdate/GoogleSoftwareUpdate.bundle/Contents/MacOS/ksadmin" 117 | if os.path.exists(ksadmin): 118 | ksadminProcess = [ksadmin, 119 | '--register', 120 | '--preserve-tttoken', 121 | '--productid', chromeKSProductID(), 122 | '--version', chromeVersion(), 123 | '--xcpath', chromePath, 124 | '--url', chromeKSUpdateURL(), 125 | '--tag-path', tagPath, 126 | '--tag-key', tagKey, 127 | '--brand-path', brandPath, 128 | '--brand-key', brandKey, 129 | '--version-path', versionPath, 130 | '--version-key', versionKey] 131 | retcode = subprocess.call(ksadminProcess) 132 | if retcode == 0: 133 | return True 134 | else: 135 | return False 136 | else: 137 | print >> sys.stderr, "Error: %s doesn't exist" % ksadmin 138 | return False 139 | 140 | 141 | def main(argv=None): 142 | if argv is None: 143 | argv = sys.argv 144 | try: 145 | # Check for root 146 | if os.geteuid() != 0: 147 | print >> sys.stderr, "This script must be run as root" 148 | return 1 149 | 150 | if not chromeIsInstalled(): 151 | print >> sys.stderr, "Error: Chrome is not installed on this computer" 152 | return 1 153 | if keystoneInstall(): 154 | print "Keystone installed" 155 | else: 156 | print >> sys.stderr, "Error: Keystone install failed" 157 | return 1 158 | if registerChromeWithKeystone(): 159 | print "Registered Chrome with Keystone" 160 | return 0 161 | else: 162 | print >> sys.stderr, "Error: Failed to register Chrome with Keystone" 163 | return 1 164 | 165 | except Usage, err: 166 | print >>sys.stderr, err.msg 167 | print >>sys.stderr, "for help use --help" 168 | return 2 169 | 170 | 171 | if __name__ == "__main__": 172 | sys.exit(main()) -------------------------------------------------------------------------------- /Imagr_101/README.md: -------------------------------------------------------------------------------- 1 | ***Example*** imagr_config.plist file used for demonstration purposes in the 101 series of blogs -------------------------------------------------------------------------------- /Imagr_101/imagr_config.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | password 6 | 844d8779103b94c18f4aa4cc0c3b4474058580a991fba85d3ca698a0bc9e52c5940feb7a65a3a290e17e6b23ee943ecc4f73e7490327245b4fe5d5efb590feb2 7 | workflows 8 | 9 | 10 | bless_target 11 | 12 | components 13 | 14 | 15 | type 16 | image 17 | url 18 | https://amsys-imagr-blog-server.local/Imagr/images/osx_updated_150820-10.10.5-14F27-2.hfs.dmg 19 | 20 | 21 | type 22 | computer_name 23 | 24 | 25 | first_boot 26 | 27 | type 28 | package 29 | url 30 | https://amsys-imagr-blog-server.local/Imagr/packages/Munki_Tools.pkg 31 | 32 | 33 | type 34 | script 35 | url 36 | https://amsys-imagr-blog-server.local/Imagr/scripts/some_script.sh 37 | 38 | 39 | description 40 | Deploys a 10.10.1 image and renames the device. 41 | name 42 | Rename and image the Mac 43 | restart_action 44 | restart 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Outlook_2016/Change_email_Domain/Change Outlook Exchange email domains - BASH.scpt: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ######################################################################################### 4 | # NAME: Change Outlook Exchnage email domains - BASH # 5 | # VERSION: 2016.06.13 # 6 | # HISTORY: v2016.06.13 - DW - Amsys - Initial Creation # 7 | # # 8 | # DESCRIPTION: Loop through the first 3 'exchange' type accounts, looking for "BADDOMAIN.COM" in both the # 9 | # username and email address fields. If found, change the domain to "GOODDOMAIN.COM". # 10 | # # 11 | # AUTHOR: DW (AMSYS) # 12 | # # 13 | # DISCLAIMER: Use at your own risk. Amsys will accept no responsibility for loss # 14 | # or damage caused by this script. # 15 | # # 16 | # USAGE: 1) Run a 'find and replace' on this script, replacing "BADDOMAIN.COM" with the exact domain # 17 | # you are looking to swap OUT. # 18 | # 2) Run a 'find and replace' on this script, replacing "GOODDOMAIN.COM" with the exact domain # 19 | # you are looking to swap IN. # 20 | # 3) Run this script on the client device # 21 | # # 22 | ######################################################################################### 23 | 24 | # Old: BADDOMAIN.COM 25 | # New: GOODDOMAIN.COM 26 | 27 | username="$3" 28 | if [ -z "$username" ]; then # Checks if the variable is empty (user running script from Self Service) 29 | username=$( python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");' ) 30 | fi 31 | echo "User: $username" 32 | 33 | su "${3}" -c osascript <<'END' 34 | tell application "Microsoft Outlook" 35 | try 36 | set emailAddress to email address of exchange account 1 37 | set username to user name of exchange account 1 38 | if ((emailAddress as string) contains "BADDOMAIN.COM") then 39 | set emailname to (do shell script "echo " & quoted form of text 1 through -2 of emailAddress & " | awk -F \"@\" '{print $1}' $1") 40 | set email address of exchange account 1 to emailname & "@GOODDOMAIN.COM" 41 | if ((username as string) contains "BADDOMAIN.COM") then 42 | set emailname to (do shell script "echo " & quoted form of text 1 through -2 of username & " | awk -F \"@\" '{print $1}' $1") 43 | set user name of exchange account 1 to emailname & "@GOODDOMAIN.COM" 44 | end if 45 | end if 46 | set emailAddress to email address of exchange account 2 47 | set username to user name of exchange account 2 48 | if ((emailAddress as string) contains "BADDOMAIN.COM") then 49 | set emailname to (do shell script "echo " & quoted form of text 1 through -2 of emailAddress & " | awk -F \"@\" '{print $1}' $1") 50 | set email address of exchange account 2 to emailname & "@GOODDOMAIN.COM" 51 | if ((username as string) contains "tonyblairfaithfoundation.org") then 52 | set emailname to (do shell script "echo " & quoted form of text 1 through -2 of username & " | awk -F \"@\" '{print $1}' $1") 53 | set user name of exchange account 2 to emailname & "@GOODDOMAIN.COM" 54 | end if 55 | end if 56 | set emailAddress to email address of exchange account 3 57 | set username to user name of exchange account 3 58 | if ((emailAddress as string) contains "BADDOMAIN.COM") then 59 | set emailname to (do shell script "echo " & quoted form of text 1 through -2 of emailAddress & " | awk -F \"@\" '{print $1}' $1") 60 | set email address of exchange account 3 to emailname & "@GOODDOMAIN.COM" 61 | if ((username as string) contains "tonyblairfaithfoundation.org") then 62 | set emailname to (do shell script "echo " & quoted form of text 1 through -2 of username & " | awk -F \"@\" '{print $1}' $1") 63 | set user name of exchange account 3 to emailname & "@GOODDOMAIN.COM" 64 | end if 65 | end if 66 | end try 67 | end tell 68 | 69 | END 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /Outlook_2016/Change_email_Domain/Change Outlook Exchange email domains.scpt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moofit/scripts/9754412559ba6e7b17e77f9fadc2ff012057264f/Outlook_2016/Change_email_Domain/Change Outlook Exchange email domains.scpt -------------------------------------------------------------------------------- /Pro Tools 12/ProTools12_Post-Install-Script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copy the com.avid.bsd.ShoeTool Helper Tool 4 | PHT_SHOETOOL="/Library/PrivilegedHelperTools/com.avid.bsd.shoetoolv120" 5 | 6 | /bin/cp -f "/Applications/Pro Tools.app/Contents/Library/LaunchServices/com.avid.bsd.shoetoolv120" $PHT_SHOETOOL 7 | /usr/sbin/chown root:wheel $PHT_SHOETOOL 8 | /bin/chmod 544 $PHT_SHOETOOL 9 | 10 | # Create the Launch Deamon Plist for com.avid.bsd.ShoeTool 11 | PLIST="/Library/LaunchDaemons/com.avid.bsd.shoetoolv120.plist" 12 | FULL_PATH="/Library/PrivilegedHelperTools/com.avid.bsd.shoetoolv120" 13 | 14 | rm $PLIST # Make sure we are idempotent 15 | 16 | /usr/libexec/PlistBuddy -c "Add Label string" $PLIST 17 | /usr/libexec/PlistBuddy -c "Set Label com.avid.bsd.shoetoolv120" $PLIST 18 | 19 | /usr/libexec/PlistBuddy -c "Add MachServices dict" $PLIST 20 | /usr/libexec/PlistBuddy -c "Add MachServices:com.avid.bsd.shoetoolv120 bool" $PLIST 21 | /usr/libexec/PlistBuddy -c "Set MachServices:com.avid.bsd.shoetoolv120 true" $PLIST 22 | 23 | /usr/libexec/PlistBuddy -c "Add ProgramArguments array" $PLIST 24 | /usr/libexec/PlistBuddy -c "Add ProgramArguments:0 string" $PLIST 25 | /usr/libexec/PlistBuddy -c "Set ProgramArguments:0 $FULL_PATH" $PLIST 26 | 27 | /bin/launchctl load $PLIST 28 | 29 | mkdir -p "/Library/Application Support/Avid/Audio/Plug-Ins" 30 | mkdir -p "/Library/Application Support/Avid/Audio/Plug-Ins (Unused)" 31 | 32 | chmod a+w "/Library/Application Support/Avid/Audio/Plug-Ins" 33 | chmod a+w "/Library/Application Support/Avid/Audio/Plug-Ins (Unused)" 34 | 35 | mkdir /Users/Shared/Pro\ Tools 36 | mkdir /Users/Shared/AvidVideoEngine 37 | 38 | chown -R root:wheel /Users/Shared/Pro\ Tools 39 | chmod -R a+rw /Users/Shared/Pro\ Tools 40 | chown -R root:wheel /Users/Shared/AvidVideoEngine 41 | chmod -R a+rw /Users/Shared/AvidVideoEngine 42 | 43 | # Get rid of old workspace 44 | rm -rf /Users/Shared/Pro\ Tools/Workspace.wksp 45 | 46 | exit 0 -------------------------------------------------------------------------------- /RADIUS/EAP-Username-Injector.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ######################################################################################### 4 | # NAME: EAP-Username-Injector # 5 | # VERSION: 2016.06.10 # 6 | # HISTORY: v2016.06.10 - DW - Amsys - Initial Creation # 7 | # # 8 | # DESCRIPTION: Inject the local computer's fully-qualified hostname into the EAP # 9 | # profile, in place of "CHANGEME". Once complete, import the profile # 10 | # into the local Computer. # 11 | # # 12 | # AUTHOR: DW (AMSYS) # 13 | # # 14 | # DISCLAIMER: Use at your own risk. Amsys will accept no responsibility for loss # 15 | # or damage caused by this script. # 16 | # # 17 | # USAGE: 1) Build a typical unsigned RADIUS profile and download. # 18 | # 2) Edit the "Username" tag in the 'EAP' section to be: # 19 | # "host/CHANGEME" # 20 | # 3) Edit line 31 below to match the name of the profile you've created # 21 | # 4) Build a package to deploy your profile into /private/tmp/ # 22 | # 5) Add this script as a post-flight/-install script # 23 | # 6) Deploy this out to booted devices. # 24 | # 7) This MUST run on a 'postponed install' (DeployStudio) # 25 | # or set as 'Install on boot drive after imaging' (Casper) # 26 | # # 27 | ########################################################################################## 28 | 29 | #################################### Variables ########################################### 30 | # Path and name of the Profile to work on (must be on the local file system) 31 | PathToTemplateProfile="/private/tmp/RADIUS template.mobileconfig" 32 | 33 | ########################################################################################## 34 | ########################### Do not edit below this line ################################## 35 | ########################################################################################## 36 | 37 | # Phrase to look for and replace in the profile with the fully-qualified hostname 38 | PhraseToReplace="CHANGEME" 39 | 40 | # Location of the LogFile to save output to 41 | LogFile="/Library/Logs/EAP-Username-Injector.log" 42 | 43 | # Placeholder for the fully-qualified hostname variable. 44 | # DO NOT ALTER 45 | FullyQualifiedHostname="" 46 | 47 | #################################### Functions ########################################### 48 | 49 | # Function to write input to the terminal and a logfile 50 | writelog() 51 | { 52 | echo "$(date) - ${1}" 53 | echo "$(date) - ${1}" >> "${LogFile}" 54 | } 55 | 56 | # Function to check for the presence of the profile to work on, and error out if not 57 | CheckForProfile () 58 | { 59 | if [[ -a "${PathToTemplateProfile}" ]]; then 60 | writelog "Template Profile Found at: ${PathToTemplateProfile}" 61 | else 62 | writelog "Template Profile NOT Found at: ${PathToTemplateProfile}" 63 | writelog "FAILURE - Template Profile Not Found" 64 | writelog "Exit code 2" 65 | exit 2 66 | fi 67 | } 68 | 69 | # Function to get the fully-qualified hostname 70 | GetFQHostname () 71 | { 72 | FullyQualifiedHostname="$(host $(hostname) | awk '{print $1}')" 73 | writelog "Fully Qualified Hostname detected as: ${FullyQualifiedHostname}" 74 | } 75 | 76 | # Function to validate the FQ Hostname is a FQ hostname 77 | ValidateFQHostname () 78 | { 79 | if [[ "${FullyQualifiedHostname}" == *"."* ]]; then 80 | writelog "Fully Qualified Hostname verified successfully" 81 | else 82 | writelog "Fully Qualified Hostname NOT verified successfully" 83 | writelog "FAILURE - Fully Qualified Hostname not detected correctly" 84 | writelog "Exit code 3" 85 | exit 3 86 | fi 87 | } 88 | 89 | # Function to inject the FQ host into the Profile 90 | InjectFQHostname () 91 | { 92 | sed -i '' -e 's/'"${PhraseToReplace}"'/'"${FullyQualifiedHostname}"'/' "${PathToTemplateProfile}" 93 | exitcode="${?}" 94 | if [[ "${exitcode}" != 0 ]]; then 95 | writelog "Failed to inject the Fully Qualified hostname into the profile with sed exit code ${exitcode}" 96 | writelog "FAILURE - Failed to inject the hostname into the profile" 97 | writelog "Exit code 4" 98 | exit 4 99 | else 100 | writelog "Successfully injected the Fully Qualified hostname into the profile" 101 | fi 102 | } 103 | 104 | # Function to install the profile into the local OS. 105 | InstallProfile () 106 | { 107 | /usr/bin/profiles -I -F "${PathToTemplateProfile}" '' 108 | exitcode="${?}" 109 | if [[ "${exitcode}" != 0 ]]; then 110 | writelog "Profile failed to install with profiles exit code ${exitcode}" 111 | writelog "FAILURE - Failed to install the profile" 112 | writelog "Exit code 5" 113 | exit 5 114 | else 115 | writelog "Profile installed successfully" 116 | fi 117 | } 118 | 119 | # Function to clear out profile file after installing 120 | RemoveProfileFile () 121 | { 122 | if [[ -a "${PathToTemplateProfile}" ]]; then 123 | rm -R "${PathToTemplateProfile}" 124 | writelog "Template Profile File removed" 125 | fi 126 | } 127 | 128 | ########################################################################################## 129 | ########################### Script Start ################################################# 130 | ########################################################################################## 131 | 132 | writelog " - - - - - - - - - - - - - - - - - - - " 133 | writelog "Starting EAP-Username-Injector script - " 134 | 135 | # Check for Profile file 136 | CheckForProfile 137 | # Check the local machine's fully qualified hostname 138 | GetFQHostname 139 | # Ensure the obtained fully qualified hostname has at least one '.' 140 | ValidateFQHostname 141 | # Add that fully qualified hostname into the profile in place of the 'PhraseToReplace' 142 | InjectFQHostname 143 | # Install the worked on template profile 144 | InstallProfile 145 | # From the unrequired profile file 146 | RemoveProfileFile 147 | 148 | writelog "EAP-Username-Injector script complete - " 149 | writelog " - - - - - - - - - - - - - - - - - - - " 150 | 151 | ########################################################################################## 152 | ########################### Script End ################################################### 153 | ########################################################################################## 154 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Logo](https://x1llu7x4a4-flywheel.netdna-ssl.com/wp-content/themes/moof/images/logo.svg) 2 | 3 | # Scripts 4 | 5 | ## Table of Contents 6 | 7 | - [Purpose](#purpose) 8 | - [How to contribute](#how-to-contribute) 9 | - [Support](#support) 10 | - [License](#license) 11 | 12 | ## Purpose 13 | 14 | This repository contains various scripts that may be freely used and reproduced if required. 15 | 16 | ## How to contribute 17 | 18 | 1. Fork this project, if required 19 | 2. Create a new branch (`git checkout -b myNewBranch`) 20 | 3. Make changes, and commit (`git commit -am "myChanges"`) 21 | 4. Push to the new branch (`git push origin myNewBranch`) 22 | 5. Create new pull request 23 | 24 | ## Support 25 | 26 | Use at your own risk. Moof IT will accept no responsibility for loss or damage caused by these scripts. Contact Moof IT if you need a custom script tailored to your environment. 27 | 28 | ## License 29 | 30 | This work is licensed under http://creativecommons.org/licenses/by/4.0/. 31 | 32 | These scripts may be freely modified for personal or commercial purposes but may not be republished for profit without prior consent. 33 | -------------------------------------------------------------------------------- /ableton_live_9/Library.cfg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /ableton_live_9/Move Ableton License file to system-wide.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | app_Location="/Applications/Ableton Live 9 Standard.app" 4 | 5 | username="$3" 6 | if [ -z "$username" ]; then # Checks if the variable is empty (user running script from Self Service) 7 | username="$USER" 8 | fi 9 | license_File_Source="/Users/${username}/Library/Application Support/Ableton/Live 9.5/Unlock/Unlock.cfg" 10 | license_File_Destination="/Library/Application Support/Ableton/Live 9.5/Unlock/" 11 | 12 | ################################# 13 | 14 | cp -R "${license_File_Source}" "${license_File_Destination}" 15 | 16 | chown -R root:admin "${license_File_Destination}" 17 | chmod -R 755 "${license_File_Destination}" 18 | 19 | exit 0 20 | 21 | 22 | -------------------------------------------------------------------------------- /ableton_live_9/Options.txt: -------------------------------------------------------------------------------- 1 | -DontAskForAdminRights 2 | -EventRecorder=Off 3 | -_DisableUsageData 4 | -_DisableAutoUpdates 5 | -------------------------------------------------------------------------------- /addWebShortcutToDesktop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ######################################################################################### 4 | # Author: Darren Wallace - Amsys 5 | # Name: addWebShortcutToDesktop.sh 6 | # 7 | # Purpose: This script will add a Web Shortcut (weblock) file to the currently 8 | # logged in user's desktop. 9 | # The URL used can be specified on line 24, and the name of the file 10 | # can be specified in line 22. 11 | # The script will bail out if it detects 'root' or blank as the logged 12 | # in user. 13 | # Usage: CLI | Jamf Pro 14 | # 15 | # Version 2017.12.14 - DW - Initial Creation 16 | # 17 | ######################################################################################### 18 | 19 | ##################################### Set variables ##################################### 20 | 21 | # Name you wish the shortcut (weblock) file to have 22 | webLockFileName="Apple Support Pages" 23 | # URL you want the shortcut to point to 24 | webLockDestination="https://www.apple.com/support" 25 | 26 | # Name of the script 27 | scriptName="addWebShortcutToDesktop.sh" 28 | # Location of the LogFile to save output to 29 | logFile="/Library/Logs/${scriptName}" 30 | # Work out the currently logged in user 31 | loggedInUser=$(/usr/bin/python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");') 32 | # Work out the final destination for the file 33 | # This next line works out the user's home, even if working direct from a network volume (yuk) 34 | eval usersNetworkHome="~${loggedInUser}" 35 | finalLocation="${usersNetworkHome}/Desktop/${webLockFileName}.webloc" 36 | 37 | ################################## Declare functions #################################### 38 | 39 | # Function to write input to the terminal and a logfile 40 | writeLog () 41 | { 42 | /bin/echo "$(date) - ${1}" 43 | /bin/echo "$(date) - ${1}" >> "${logFile}" 44 | } 45 | 46 | ##################################### Run Script ####################################### 47 | 48 | writeLog "Starting script: ${scriptName}" 49 | 50 | # Check if the current user is 'root' or blank 51 | if [[ "${loggedInUser}" == "root" ]]; then 52 | # Current user detected as root so we will exit 53 | writeLog "Current user detected as 'root', bailing out..." 54 | exit 0 55 | elif [[ "${loggedInUser}" == "" ]]; then 56 | # Current user detected as blank so we will exit 57 | writeLog "Current user detected as blank, bailing out..." 58 | exit 0 59 | fi 60 | 61 | # Current user detected correctly, so off we go 62 | writeLog "Saving shortcut to: ${finalLocation}" 63 | 64 | # Create Web lock file 65 | /bin/echo " 66 | 67 | 68 | 69 | URL 70 | ${webLockDestination} 71 | 72 | " > "${finalLocation}" 73 | 74 | # Permission the file correctly 75 | /usr/sbin/chown "${loggedInUser}" "${finalLocation}" 76 | 77 | ##################################### End Script ####################################### 78 | -------------------------------------------------------------------------------- /appQuit/README.md: -------------------------------------------------------------------------------- 1 | This little script can be used to quit OS X apps gracefully. 2 | 3 | Usage: 4 | 5 | quit.sh "name of your app" 6 | 7 | E.g. quit.sh Chess.app 8 | -------------------------------------------------------------------------------- /appQuit/quit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #!/bin/sh 4 | 5 | ################################# 6 | # 7 | # appQuit script 8 | # 9 | # Gracefully quits apps passed to it. 10 | # 11 | # Usage: appQuit.sh nameof app 12 | # E.g: appQuit.sh Calculator.app 13 | # 14 | # Created by David Acland - Amsys 15 | # 16 | # Use at your own risk. Amsys will accept 17 | # no responsibility for loss or damage 18 | # caused by this script. 19 | # 20 | ################################# 21 | 22 | echo | osascript <${dateformat}" 7 | -------------------------------------------------------------------------------- /check_ad_jss.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Variables 4 | 5 | apiURL="https://your.jss.com:8443" 6 | apiUser="EA_API_USER" 7 | apiPass="EA_API_PASSWORD" 8 | 9 | ###### Do not edit below this line 10 | 11 | dscacheutil -flushcache 12 | 13 | sleep 5 14 | 15 | # Check if the computer is on the network by reading its own computer object from AD 16 | 17 | # Get Domain from full structure, cut the name and remove space. 18 | ShortDomainName=`dscl /Active\ Directory/ -read . | grep SubNodes | sed 's|SubNodes: ||g'` 19 | 20 | computer=$(dsconfigad -show | grep "Computer Account" | awk '{ print $4 }') 21 | dscl /Active\ Directory/$ShortDomainName/All\ Domains -read /Computers/$computer RecordName &>/dev/null 22 | 23 | if [ ! $? == 0 ] ; then 24 | result="No connection to the domain" 25 | exit 1 26 | else 27 | result="Connected to $ShortDomainName" 28 | fi 29 | 30 | # Upload result of AD connection test 31 | 32 | echo "" > /private/tmp/EA.xml 33 | echo " " >> /private/tmp/EA.xml 34 | echo " " >> /private/tmp/EA.xml 35 | echo " AD Connection Status" >> /private/tmp/EA.xml 36 | echo " $result" >> /private/tmp/EA.xml 37 | echo " " >> /private/tmp/EA.xml 38 | echo " " >> /private/tmp/EA.xml 39 | echo "" >> /private/tmp/EA.xml 40 | 41 | serial=$(system_profiler SPHardwareDataType | grep 'Serial Number (system)' | awk '{print $NF}') 42 | echo $serial 43 | curl -sfku $apiUser:$apiPass $apiURL/JSSResource/computers/serialnumber/$serial/subset/extensionattributes -T /private/tmp/EA.xml -X PUT 44 | 45 | sleep 5 46 | 47 | #rm /private/tmp/EA.xml 48 | 49 | exit 0 50 | -------------------------------------------------------------------------------- /configureLoginWindowAccess.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ######################################################################################### 4 | # Author: Darren Wallace - Amsys 5 | # Name: configureLoginWindowAccess.sh 6 | # 7 | # Purpose: This script will configure the login window to only allow users who 8 | # are a member of the user group specified in line 33 to login. 9 | # Please Note: This group needs to be accessable by the end device 10 | # E.g. if using an AD group, the device must be bound to AD before 11 | # pushing this script out. 12 | # Optionally, it can also be used to also allow local admin users or 13 | # all local users, by editing line 36. 14 | # "admin" will only add the specified group and the local 'admin' 15 | # group. "all" will only add the specified group and all local users. 16 | # 17 | # Credit: Thanks to Greg Neagle's post on JamfNation for the details on what was requried 18 | # https://www.jamf.com/jamf-nation/discussions/14476/automate-mobile-users-allowed-to-log-in-to-a-system-as-the-first-user-to-login-only#responseChild88282 19 | # 20 | # Usage: CLI | Jamf Pro 21 | # 22 | # Version 2017.12.12 - DW - Initial Creation 23 | # 24 | ######################################################################################### 25 | 26 | ##################################### Set variables ##################################### 27 | 28 | # Name of the script 29 | scriptName="configureLoginWindowAccess.sh" 30 | # Location of the LogFile to save output to 31 | logFile="/Library/Logs/${scriptName}" 32 | # Name of group that is allow to log into the Mac (AD, OD or Local) 33 | allowGroup="AllowedMacUsers" 34 | # Should local users also have access? 35 | # Acceptable Answers: "admin" "all" "no" (all lower case) 36 | extraUsers="admin" 37 | 38 | ################################## Declare functions #################################### 39 | 40 | # Function to write input to the terminal and a logfile 41 | writeLog () 42 | { 43 | /bin/echo "$(date) - ${1}" 44 | /bin/echo "$(date) - ${1}" >> "${logFile}" 45 | } 46 | 47 | ##################################### Run Script ####################################### 48 | 49 | writeLog "Starting script: ${scriptName}" 50 | 51 | # Create the two required groups to limit AD access at the login window 52 | writeLog "Creating the com.apple.loginwindow.netaccounts group" 53 | /usr/bin/dscl . -create /Groups/com.apple.loginwindow.netaccounts 54 | # Figure out the next free GID 55 | nextGID=$(/usr/bin/dscl . -list /Groups PrimaryGroupID | /usr/bin/awk 'BEGIN{i=0}{if($2>i)i=$2}END{print i+1}') 56 | /usr/bin/dscl . -create /Groups/com.apple.loginwindow.netaccounts PrimaryGroupID "${nextGID}" 57 | writeLog "Creating the com.apple.access_loginwindow group" 58 | /usr/bin/dscl . -create /Groups/com.apple.access_loginwindow 59 | # Figure out the next free GID 60 | nextGID=$(/usr/bin/dscl . -list /Groups PrimaryGroupID | /usr/bin/awk 'BEGIN{i=0}{if($2>i)i=$2}END{print i+1}') 61 | /usr/bin/dscl . -create /Groups/com.apple.access_loginwindow PrimaryGroupID "${nextGID}" 62 | 63 | # Add the primary group ($allowGroup) to the 'allow' login list 64 | writeLog "Adding the primary group to the login allow list" 65 | /usr/sbin/dseditgroup -o edit -n /Local/Default -a "${allowGroup}" -t group com.apple.loginwindow.netaccounts 66 | 67 | # Adding the netaccounts group to the access group 68 | writeLog "Adding the netaccounts group to the access group" 69 | /usr/sbin/dseditgroup -o edit -n /Local/Default -a com.apple.loginwindow.netaccounts -t group com.apple.access_loginwindow 70 | 71 | # Check if there are additional groups to be added 72 | writeLog "Check if there are additional groups to be added" 73 | if [[ "${extraUsers}" == "admin" ]]; then 74 | writeLog "Adding the admin group to the access list" 75 | /usr/sbin/dseditgroup -o edit -n /Local/Default -a admin -t group com.apple.access_loginwindow 76 | elif [[ "${extraUsers}" == "all" ]]; then 77 | writeLog "Adding all local users group (localaccounts) to the access list" 78 | /usr/sbin/dseditgroup -o edit -n /Local/Default -a localaccounts -t group com.apple.access_loginwindow 79 | else 80 | writeLog "No additional users to add" 81 | fi 82 | 83 | writeLog "Script Complete" 84 | 85 | exit 86 | 87 | ##################################### End Script ####################################### 88 | -------------------------------------------------------------------------------- /createRecovery.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ###################################### 4 | # 5 | # Create Recovery script 6 | # 7 | # Usage: ./createRecovery.sh 8 | # 9 | # Created by Amsys 10 | # 11 | # Use at your own risk. Amsys will accept 12 | # no responsibility for loss or damage 13 | # caused by this script. 14 | # 15 | # The script will perform the following tasks: 16 | # 17 | # 1. Set the macOS installer path as a variable 18 | # 2. Set the target disk as a variable 19 | # 3. Download the RecoveryHDUpdate.dmg into /private/tmp 20 | # 4. Open the disk image 21 | # 5. Expand the enclosed "RecoveryHDUpdate.pkg" package 22 | # 6. Eject the disk image 23 | # 7. Create or modify the Recovery partition 24 | # 25 | ###################################### 26 | 27 | # Set the macOS installer path as a variable 28 | MACOS_INSTALLER="/Applications/$(ls /Applications | grep "Install macOS")" # Path to your macOS installer 29 | echo "macOS installer is $MACOS_INSTALLER" 30 | 31 | # Set the target disk as a variable 32 | TARGET=$(diskutil info "$(bless --info --getBoot)" | awk -F':' '/Volume Name/ { print $2 }' | sed -e 's/^[[:space:]]*//') 33 | echo "Target disk is $TARGET" 34 | 35 | # Download the RecoveryHDUpdate.dmg into /private/tmp 36 | curl http://support.apple.com/downloads/DL1464/en_US/RecoveryHDUpdate.dmg -L -o /private/tmp/RecoveryHDUpdate.dmg 37 | echo "Downloaded RecoveryHDUpdate.dmg into /private/tmp" 38 | 39 | # Open the disk image 40 | hdiutil attach /private/tmp/RecoveryHDUpdate.dmg 41 | 42 | # Expand the enclosed "RecoveryHDUpdate.pkg" package 43 | pkgutil --expand /Volumes/Mac\ OS\ X\ Lion\ Recovery\ HD\ Update/RecoveryHDUpdate.pkg /private/tmp/recoveryupdate 44 | echo "RecoveryHDUpdate.pkg expanded into /private/tmp/recoveryupdate" 45 | 46 | # Eject the disk image 47 | hdiutil eject "/Volumes/Mac OS X Lion Recovery HD Update" 48 | 49 | if [ "$MACOS_INSTALLER" = "/Applications/Install macOS High Sierra.app" ]; then 50 | # Create or modify the Recovery partition (10.13) 51 | echo "Installer is macOS High Sierra" 52 | /private/tmp/recoveryupdate/RecoveryHDUpdate.pkg/Scripts/Tools/dmtest ensureRecoveryPartition "$TARGET" "$MACOS_INSTALLER/Contents/SharedSupport/BaseSystem.dmg" 0 0 "$MACOS_INSTALLER/Contents/SharedSupport/BaseSystem.chunklist" 53 | echo "Finished creating High Sierra Recovery HD" 54 | else 55 | if [ "$MACOS_INSTALLER" = "/Applications/Install macOS Sierra.app" ]; then 56 | # Create or modify the Recovery partition (10.12) 57 | echo "Installer is macOS Sierra" 58 | hdiutil mount "$MACOS_INSTALLER/Contents/SharedSupport/InstallESD.dmg" 59 | /private/tmp/recoveryupdate/RecoveryHDUpdate.pkg/Scripts/Tools/dmtest ensureRecoveryPartition "$TARGET" "/Volumes/OS X Install ESD/BaseSystem.dmg" 0 0 "/Volumes/OS X Install ESD/BaseSystem.chunklist" 60 | hdiutil eject "/Volumes/OS X Install ESD" 61 | echo "Finished creating Sierra Recovery HD" 62 | fi 63 | fi 64 | -------------------------------------------------------------------------------- /delete_folders.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # WARNING - This script deletes folders (intentionally) 4 | # Use at your own risk 5 | # Intended for use on shared computers in AD environments where old home folders build up over time 6 | # In this example we are targetting the contents of the /Users directory 7 | # Replace "ABC123" with the string you want to search for 8 | # The script will delete all items it finds that start with the specified string 9 | 10 | ls /Users | grep '^ABC123' | while read folder ; do echo "Deleting /Users/$folder" && rm -R "/Users/$folder" ; done 11 | 12 | exit 0 13 | -------------------------------------------------------------------------------- /delete_keychains/README.md: -------------------------------------------------------------------------------- 1 | This script can be used to delete local keychains for the logged in user. 2 | 3 | This is generally used in education settings where the Macs are shared devices. Setting this script to run at logout ensures that the user won't get keychain errors when they login, if they have changed their password elsewhere. 4 | 5 | We would recommend setting to run at logout via a logout hook, or by using your mac management system: 6 | 7 | defaults write com.apple.loginwindow LogoutHook /path/to/script.sh 8 | -------------------------------------------------------------------------------- /delete_keychains/delete_keychains.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ################################# 4 | # 5 | # delete_keychains script 6 | # 7 | # Deletes the contents of the ~/Library/Keychains/ directory 8 | # when run. 9 | # 10 | # Created by David Acland - Amsys 11 | # 12 | # Use at your own risk. Amsys will accept 13 | # no responsibility for loss or damage 14 | # caused by this script. 15 | # 16 | ################################# 17 | 18 | loggedInUser=`python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");'` 19 | echo "Logging out user: $loggedInUser" 20 | 21 | rm -Rf /Users/$loggedInUser/Library/Keychains/* 22 | echo "Removing user Keychain items: $?" 23 | 24 | foldercontents=`ls /Users/$loggedInUser/Library/Keychains/` 25 | echo "Contents of user Keychain folder: $foldercontents" 26 | 27 | exit 0 -------------------------------------------------------------------------------- /disableJavaAutoUpdates.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Author: Stephen Bygrave - Moof IT 4 | # Name: disableJavaAutoUpdates.sh 5 | # 6 | # Purpose: Checks to see the status of the Java AutoUpdater, and disables if 7 | # necessary. 8 | # Usage: Can be run as a ongoing login policy in Jamf, as this will remediate 9 | # automatically when a user logs in, if the updater is enabled. 10 | # 11 | # Version 1.0.0, 2018-05-05 12 | # SB - Initial Creation 13 | 14 | # Use at your own risk. Moof IT will accept no responsibility for loss or damage 15 | # caused by this script. 16 | 17 | ##### Set variables 18 | 19 | logProcess="disableJavaAutoUpdates" 20 | 21 | ##### Declare functions 22 | 23 | writelog () 24 | { 25 | /usr/bin/logger -is -t "${logProcess}" "${1}" 26 | if [[ -e "/var/log/jamf.log" ]]; 27 | then 28 | /bin/echo "$(date +"%a %b %d %T") $(hostname -f | awk -F "." '{print $1}') jamf[${logProcess}]: ${1}" >> "/var/log/jamf.log" 29 | fi 30 | } 31 | 32 | echoVariables () 33 | { 34 | writelog "Log Process is ${logProcess}" 35 | } 36 | 37 | checkJavaPreferences () 38 | { 39 | if [[ -e /Library/Preferences/com.oracle.java.Java-Updater.plist ]]; 40 | then 41 | writelog "Java AutoUpdate preference file found." 42 | else 43 | writelog "Java AutoUpdate preference file not found. Java may not be installed. Exiting..." 44 | exit 1 45 | fi 46 | } 47 | 48 | disableAutoUpdate () 49 | { 50 | /usr/bin/defaults write /Library/Preferences/com.oracle.java.Java-Updater JavaAutoUpdateEnabled -bool false 51 | if [[ $? -eq 0 ]]; 52 | then 53 | writelog "Java AutoUpdate disabled." 54 | else 55 | writelog "Unable to disable Java AutoUpdate. Bailing..." 56 | exit 1 57 | fi 58 | } 59 | 60 | ##### Run script 61 | 62 | echoVariables 63 | checkJavaPreferences 64 | disableAutoUpdate 65 | 66 | writelog "Script completed." 67 | -------------------------------------------------------------------------------- /disable_flash_auto_updates.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Disable Adobe Flash auto updates with sed 4 | 5 | sed -i '' -e 's/SilentAutoUpdateEnable=1/SilentAutoUpdateEnable=0/' /Library/Application\ Support/Macromedia/mms.cfg 6 | sed -i '' -e 's/AutoUpdateDisable=0/AutoUpdateDisable=1/' /Library/Application\ Support/Macromedia/mms.cfg 7 | 8 | exit 0 9 | -------------------------------------------------------------------------------- /distnoted_watchdog/pkgbuild/ROOT/Library/LaunchDaemons/uk.co.amsys.distnoted_watchdog.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Disabled 6 | 7 | EnvironmentVariables 8 | 9 | PATH 10 | /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin 11 | 12 | Label 13 | distnoted_watchdog 14 | ProgramArguments 15 | 16 | /usr/local/bin/distnoted_watchdog.sh 17 | 18 | RunAtLoad 19 | 20 | StartInterval 21 | 60 22 | 23 | 24 | -------------------------------------------------------------------------------- /distnoted_watchdog/pkgbuild/ROOT/usr/local/bin/distnoted_watchdog.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | PATH=/bin:/usr/bin 4 | export PATH 5 | logger "Checking distnoted" 6 | 7 | # check for runaway distnoted, kill if necessary 8 | ps -reo '%cpu,uid,pid,command' | 9 | awk -v UID=$UID ' 10 | /distnoted agent$/ && $1 > 85.0 && $2 == UID { 11 | system("kill -9 " $3) 12 | } 13 | ' 14 | -------------------------------------------------------------------------------- /distnoted_watchdog/pkgbuild/distnoted_watchdog-1.1.pkg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/moofit/scripts/9754412559ba6e7b17e77f9fadc2ff012057264f/distnoted_watchdog/pkgbuild/distnoted_watchdog-1.1.pkg -------------------------------------------------------------------------------- /distnoted_watchdog/pkgbuild/scripts/postinstall: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | /bin/launchctl load "/Library/LaunchDaemons/uk.co.amsys.distnoted_watchdog.plist" 4 | 5 | exit 0 6 | -------------------------------------------------------------------------------- /distnoted_watchdog/pkgbuild/scripts/preinstall: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if /bin/launchctl list "uk.co.amsys.distnoted_watchdog" &> /dev/null; 4 | then 5 | /bin/launchctl unload "/Library/LaunchDaemons/uk.co.amsys.distnoted_watchdog.plist" 6 | /bin/rm "/Library/LaunchDaemons/uk.co.amsys.distnoted_watchdog.plist" 7 | fi 8 | 9 | if [[ -f "/usr/local/bin/distnoted_watchdog.sh" ]]; 10 | then 11 | rm "/usr/local/bin/distnoted_watchdog.sh" 12 | fi 13 | 14 | if [[ -f "/Library/TCG/scripts/distnotedmonitor.sh" ]]; 15 | then 16 | rm "/Library/TCG/scripts/distnotedmonitor.sh" 17 | fi 18 | 19 | exit 0 20 | -------------------------------------------------------------------------------- /distnoted_watchdog/readme.md: -------------------------------------------------------------------------------- 1 | To create an installer, navigate to the "pkgbuild" directory in Terminal and run the following command: 2 | 3 | pkgbuild --identifier uk.co.amsys.distnoted_watchdog --root ./ROOT/ --scripts ./scripts --version 1.1 ./distnoted_watchdog-1.1.pkg 4 | -------------------------------------------------------------------------------- /first_boot/10.10_firstBoot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Created by Amsys 4 | # 5 | # Use at your own risk. Amsys will accept 6 | # no responsibility for loss or damage 7 | # caused by this script. 8 | 9 | # Requires 10.10 or higher. 10 | 11 | ############### 12 | ## variables ## 13 | ############### 14 | PLBUDDY=/usr/libexec/PlistBuddy 15 | KEYBOARDNAME="British" 16 | KEYBOARDCODE="2" 17 | LANG="en" 18 | REGION="en_GB" 19 | ARD="/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart" 20 | SUBMIT_TO_APPLE=NO 21 | SUBMIT_TO_APP_DEVELOPERS=NO 22 | 23 | ############################################################## 24 | ######### Advanced Modification Only Below This Line ######### 25 | ############################################################## 26 | 27 | ############### 28 | ## functions ## 29 | ############### 30 | 31 | update_kdb_layout() { 32 | ${PLBUDDY} -c "Delete :AppleCurrentKeyboardLayoutInputSourceID" "${1}" &>/dev/null 33 | if [ ${?} -eq 0 ] 34 | then 35 | ${PLBUDDY} -c "Add :AppleCurrentKeyboardLayoutInputSourceID string com.apple.keylayout.${KEYBOARDNAME}" "${1}" 36 | fi 37 | 38 | for SOURCE in AppleDefaultAsciiInputSource AppleCurrentAsciiInputSource AppleCurrentInputSource AppleEnabledInputSources AppleSelectedInputSources 39 | do 40 | ${PLBUDDY} -c "Delete :${SOURCE}" "${1}" &>/dev/null 41 | if [ ${?} -eq 0 ] 42 | then 43 | ${PLBUDDY} -c "Add :${SOURCE} array" "${1}" 44 | ${PLBUDDY} -c "Add :${SOURCE}:0 dict" "${1}" 45 | ${PLBUDDY} -c "Add :${SOURCE}:0:InputSourceKind string 'Keyboard Layout'" "${1}" 46 | ${PLBUDDY} -c "Add :${SOURCE}:0:KeyboardLayout\ ID integer ${KEYBOARDCODE}" "${1}" 47 | ${PLBUDDY} -c "Add :${SOURCE}:0:KeyboardLayout\ Name string '${KEYBOARDNAME}'" "${1}" 48 | fi 49 | done 50 | } 51 | 52 | update_language() { 53 | ${PLBUDDY} -c "Delete :AppleLanguages" "${1}" &>/dev/null 54 | if [ ${?} -eq 0 ] 55 | then 56 | ${PLBUDDY} -c "Add :AppleLanguages array" "${1}" 57 | ${PLBUDDY} -c "Add :AppleLanguages:0 string '${LANG}'" "${1}" 58 | fi 59 | } 60 | 61 | update_region() { 62 | ${PLBUDDY} -c "Delete :AppleLocale" "${1}" &>/dev/null 63 | ${PLBUDDY} -c "Add :AppleLocale string ${REGION}" "${1}" &>/dev/null 64 | ${PLBUDDY} -c "Delete :Country" "${1}" &>/dev/null 65 | ${PLBUDDY} -c "Add :Country string ${REGION:3:2}" "${1}" &>/dev/null 66 | } 67 | 68 | 69 | ##################### 70 | ## Script Commands ## 71 | ##################### 72 | 73 | # Create a local admin user account 74 | sysadminctl -addUser localadmin -fullName "Local Admin" -UID 499 -password "apassword" -home /var/localadmin -admin 75 | 76 | # Set the time zone to London 77 | /usr/sbin/systemsetup -settimezone "Europe/London" 78 | 79 | # Enable network time servers 80 | /usr/sbin/systemsetup -setusingnetworktime on 81 | 82 | # Configure a specific NTP server 83 | /usr/sbin/systemsetup -setnetworktimeserver "ntp.amsys.co.uk" 84 | 85 | # Change Keyboard Layout 86 | update_kdb_layout "/Library/Preferences/com.apple.HIToolbox.plist" "${KEYBOARDNAME}" "${KEYBOARDCODE}" 87 | 88 | for HOME in /Users/* 89 | do 90 | if [ -d "${HOME}"/Library/Preferences ] 91 | then 92 | cd "${HOME}"/Library/Preferences 93 | HITOOLBOX_FILES=`find . -name "com.apple.HIToolbox.*plist"` 94 | for HITOOLBOX_FILE in ${HITOOLBOX_FILES} 95 | do 96 | update_kdb_layout "${HITOOLBOX_FILE}" "${KEYBOARDNAME}" "${KEYBOARDCODE}" 97 | done 98 | fi 99 | done 100 | 101 | # Set the computer language 102 | update_language "/Library/Preferences/.GlobalPreferences.plist" "${LANG}" 103 | 104 | for HOME in /Users/* 105 | do 106 | if [ -d "${HOME}"/Library/Preferences ] 107 | then 108 | cd "${HOME}"/Library/Preferences 109 | GLOBALPREFERENCES_FILES=`find . -name "\.GlobalPreferences.*plist"` 110 | for GLOBALPREFERENCES_FILE in ${GLOBALPREFERENCES_FILES} 111 | do 112 | update_language "${GLOBALPREFERENCES_FILE}" "${LANG}" 113 | done 114 | fi 115 | done 116 | 117 | # Set the region 118 | update_region "/Library/Preferences/.GlobalPreferences.plist" "${REGION}" 119 | 120 | for HOME in /Users/* 121 | do 122 | if [ -d "${HOME}"/Library/Preferences ] 123 | then 124 | cd "${HOME}"/Library/Preferences 125 | GLOBALPREFERENCES_FILES=`find . -name "\.GlobalPreferences.*plist"` 126 | for GLOBALPREFERENCES_FILE in ${GLOBALPREFERENCES_FILES} 127 | do 128 | update_region "${GLOBALPREFERENCES_FILE}" "${REGION}" 129 | done 130 | fi 131 | done 132 | 133 | # Switch on Apple Remote Desktop 134 | $ARD -configure -activate 135 | 136 | # Configure ARD access for the localadmin user 137 | $ARD -configure -access -on 138 | $ARD -configure -allowAccessFor -specifiedUsers 139 | $ARD -configure -access -on -users localadmin -privs -all 140 | 141 | # Enable SSH 142 | systemsetup -setremotelogin on 143 | 144 | # Configure Login Window to username and password text fields 145 | /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow SHOWFULLNAME -bool true 146 | 147 | # Enable admin info at the Login Window 148 | /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName 149 | 150 | # Disable External Accounts at the Login Window 151 | /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow EnableExternalAccounts -bool false 152 | 153 | # Disable iCloud for logging in users 154 | osvers=$(sw_vers -productVersion | awk -F. '{print $2}') 155 | sw_vers=$(sw_vers -productVersion) 156 | 157 | for USER_TEMPLATE in "/System/Library/User Template"/* 158 | do 159 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant DidSeeCloudSetup -bool TRUE 160 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant GestureMovieSeen none 161 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant LastSeenCloudProductVersion "${sw_vers}" 162 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant LastSeenBuddyBuildVersion "${sw_build}" 163 | done 164 | 165 | for USER_HOME in /Users/* 166 | do 167 | USER_UID=`basename "${USER_HOME}"` 168 | if [ ! "${USER_UID}" = "Shared" ] 169 | then 170 | if [ ! -d "${USER_HOME}"/Library/Preferences ] 171 | then 172 | mkdir -p "${USER_HOME}"/Library/Preferences 173 | chown "${USER_UID}" "${USER_HOME}"/Library 174 | chown "${USER_UID}" "${USER_HOME}"/Library/Preferences 175 | fi 176 | if [ -d "${USER_HOME}"/Library/Preferences ] 177 | then 178 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.SetupAssistant DidSeeCloudSetup -bool TRUE 179 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.SetupAssistant GestureMovieSeen none 180 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.SetupAssistant LastSeenCloudProductVersion "${sw_vers}" 181 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.SetupAssistant LastSeenBuddyBuildVersion "${sw_build}" 182 | chown "${USER_UID}" "${USER_HOME}"/Library/Preferences/com.apple.SetupAssistant.plist 183 | fi 184 | fi 185 | done 186 | 187 | # Disable diagnostics at login 188 | if [ $osvers -ge 10 ]; then 189 | CRASHREPORTER_SUPPORT="/Library/Application Support/CrashReporter" 190 | CRASHREPORTER_DIAG_PLIST="${CRASHREPORTER_SUPPORT}/DiagnosticMessagesHistory.plist" 191 | 192 | if [ ! -d "${CRASHREPORTER_SUPPORT}" ]; then 193 | mkdir "${CRASHREPORTER_SUPPORT}" 194 | chmod 775 "${CRASHREPORTER_SUPPORT}" 195 | chown root:admin "${CRASHREPORTER_SUPPORT}" 196 | fi 197 | 198 | for key in AutoSubmit AutoSubmitVersion ThirdPartyDataSubmit ThirdPartyDataSubmitVersion; do 199 | $PlistBuddy -c "Delete :$key" "${CRASHREPORTER_DIAG_PLIST}" 2> /dev/null 200 | done 201 | 202 | $PlistBuddy -c "Add :AutoSubmit bool ${SUBMIT_TO_APPLE}" "${CRASHREPORTER_DIAG_PLIST}" 203 | $PlistBuddy -c "Add :AutoSubmitVersion integer 4" "${CRASHREPORTER_DIAG_PLIST}" 204 | $PlistBuddy -c "Add :ThirdPartyDataSubmit bool ${SUBMIT_TO_APP_DEVELOPERS}" "${CRASHREPORTER_DIAG_PLIST}" 205 | $PlistBuddy -c "Add :ThirdPartyDataSubmitVersion integer 4" "${CRASHREPORTER_DIAG_PLIST}" 206 | fi 207 | 208 | # Disable Time Machine Popups offering for new disks 209 | /usr/bin/defaults write /Library/Preferences/com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true 210 | 211 | # Turn off Gatekeeper 212 | spctl --master-disable 213 | 214 | # Turn on right-click for mouse and trackpad 215 | for USER_TEMPLATE in "/System/Library/User Template"/* 216 | do 217 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.driver.AppleHIDMouse Button2 -int 2 218 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.driver.AppleBluetoothMultitouch.mouse MouseButtonMode -string TwoButton 219 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -int 1 220 | done 221 | 222 | for USER_HOME in /Users/* 223 | do 224 | USER_UID=`basename "${USER_HOME}"` 225 | if [ ! "${USER_UID}" = "Shared" ] 226 | then 227 | if [ ! -d "${USER_HOME}"/Library/Preferences ] 228 | then 229 | mkdir -p "${USER_HOME}"/Library/Preferences 230 | chown "${USER_UID}" "${USER_HOME}"/Library 231 | chown "${USER_UID}" "${USER_HOME}"/Library/Preferences 232 | fi 233 | if [ -d "${USER_HOME}"/Library/Preferences ] 234 | then 235 | killall -u $USER_UID cfprefsd 236 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.driver.AppleHIDMouse Button2 -int 2 237 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.driver.AppleBluetoothMultitouch.mouse MouseButtonMode -string TwoButton 238 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -int 1 239 | fi 240 | fi 241 | done 242 | 243 | # Turn off restore windows 244 | for USER_TEMPLATE in "/System/Library/User Template"/* 245 | do 246 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/.GlobalPreferences NSQuitAlwaysKeepsWindows -boolean FALSE 247 | done 248 | 249 | for USER_HOME in /Users/* 250 | do 251 | USER_UID=`basename "${USER_HOME}"` 252 | if [ ! "${USER_UID}" = "Shared" ] 253 | then 254 | if [ ! -d "${USER_HOME}"/Library/Preferences ] 255 | then 256 | mkdir -p "${USER_HOME}"/Library/Preferences 257 | chown "${USER_UID}" "${USER_HOME}"/Library 258 | chown "${USER_UID}" "${USER_HOME}"/Library/Preferences 259 | fi 260 | if [ -d "${USER_HOME}"/Library/Preferences ] 261 | then 262 | killall -u $USER_UID cfprefsd 263 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/.GlobalPreferences NSQuitAlwaysKeepsWindows -boolean FALSE 264 | fi 265 | fi 266 | done 267 | 268 | # Stop writing .DS_Store files on the network 269 | for USER_TEMPLATE in "/System/Library/User Template"/* 270 | do 271 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/.GlobalPreferences DSDontWriteNetworkStores -bool TRUE 272 | done 273 | 274 | for USER_HOME in /Users/* 275 | do 276 | USER_UID=`basename "${USER_HOME}"` 277 | if [ ! "${USER_UID}" = "Shared" ] 278 | then 279 | if [ ! -d "${USER_HOME}"/Library/Preferences ] 280 | then 281 | mkdir -p "${USER_HOME}"/Library/Preferences 282 | chown "${USER_UID}" "${USER_HOME}"/Library 283 | chown "${USER_UID}" "${USER_HOME}"/Library/Preferences 284 | fi 285 | if [ -d "${USER_HOME}"/Library/Preferences ] 286 | then 287 | killall -u $USER_UID cfprefsd 288 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/.GlobalPreferences DSDontWriteNetworkStores -bool TRUE 289 | fi 290 | fi 291 | done 292 | 293 | exit 0 -------------------------------------------------------------------------------- /first_boot/10.12_first_boot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Created by Amsys 4 | # 5 | # Use at your own risk. Amsys will accept 6 | # no responsibility for loss or damage 7 | # caused by this script. 8 | # 9 | # Requires 10.10 or higher. 10 | 11 | ############### 12 | ## variables ## 13 | ############### 14 | 15 | # Make sure to change these variables 16 | LOCAL_ADMIN_FULLNAME="Local Administrator" # The local admin user's full name 17 | LOCAL_ADMIN_SHORTNAME="ladmin" # The local admin user's shortname 18 | LOCAL_ADMIN_PASSWORD="password" # The local admin user's password 19 | KEYBOARDNAME="British" # Keyboard name 20 | KEYBOARDCODE="2" # Keyboard layout code (currently set to British) 21 | LANG="en" # macOS language 22 | REGION="en_GB" # macOS region 23 | SUBMIT_TO_APPLE=NO # Choose whether to submit diagnostic information to Apple 24 | SUBMIT_TO_APP_DEVELOPERS=NO # Choose whether to submit diagnostic information to 3rd party developers 25 | 26 | #### These variables can be left alone 27 | PLBUDDY=/usr/libexec/PlistBuddy 28 | SW_VERS=$(sw_vers -productVersion) 29 | BUILD_VERS=$(sw_vers -buildVersion) 30 | ARD="/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart" 31 | CRASHREPORTER_SUPPORT="/Library/Application Support/CrashReporter" 32 | CRASHREPORTER_DIAG_PLIST="${CRASHREPORTER_SUPPORT}/DiagnosticMessagesHistory.plist" 33 | 34 | ############################################# 35 | ######## Do not edit below this line ######## 36 | ############################################# 37 | 38 | ############### 39 | ## functions ## 40 | ############### 41 | 42 | update_kdb_layout() { 43 | ${PLBUDDY} -c "Delete :AppleCurrentKeyboardLayoutInputSourceID" "${1}" &>/dev/null 44 | if [ ${?} -eq 0 ] 45 | then 46 | ${PLBUDDY} -c "Add :AppleCurrentKeyboardLayoutInputSourceID string com.apple.keylayout.${KEYBOARDNAME}" "${1}" 47 | fi 48 | 49 | for SOURCE in AppleDefaultAsciiInputSource AppleCurrentAsciiInputSource AppleCurrentInputSource AppleEnabledInputSources AppleSelectedInputSources 50 | do 51 | ${PLBUDDY} -c "Delete :${SOURCE}" "${1}" &>/dev/null 52 | if [ ${?} -eq 0 ] 53 | then 54 | ${PLBUDDY} -c "Add :${SOURCE} array" "${1}" 55 | ${PLBUDDY} -c "Add :${SOURCE}:0 dict" "${1}" 56 | ${PLBUDDY} -c "Add :${SOURCE}:0:InputSourceKind string 'Keyboard Layout'" "${1}" 57 | ${PLBUDDY} -c "Add :${SOURCE}:0:KeyboardLayout\ ID integer ${KEYBOARDCODE}" "${1}" 58 | ${PLBUDDY} -c "Add :${SOURCE}:0:KeyboardLayout\ Name string '${KEYBOARDNAME}'" "${1}" 59 | fi 60 | done 61 | } 62 | 63 | update_language() { 64 | ${PLBUDDY} -c "Delete :AppleLanguages" "${1}" &>/dev/null 65 | if [ ${?} -eq 0 ] 66 | then 67 | ${PLBUDDY} -c "Add :AppleLanguages array" "${1}" 68 | ${PLBUDDY} -c "Add :AppleLanguages:0 string '${LANG}'" "${1}" 69 | fi 70 | } 71 | 72 | update_region() { 73 | ${PLBUDDY} -c "Delete :AppleLocale" "${1}" &>/dev/null 74 | ${PLBUDDY} -c "Add :AppleLocale string ${REGION}" "${1}" &>/dev/null 75 | ${PLBUDDY} -c "Delete :Country" "${1}" &>/dev/null 76 | ${PLBUDDY} -c "Add :Country string ${REGION:3:2}" "${1}" &>/dev/null 77 | } 78 | 79 | ################ 80 | #### Script #### 81 | ################ 82 | 83 | # Change Keyboard Layout 84 | update_kdb_layout "/Library/Preferences/com.apple.HIToolbox.plist" "${KEYBOARDNAME}" "${KEYBOARDCODE}" 85 | 86 | for HOME in /Users/* 87 | do 88 | if [ -d "${HOME}"/Library/Preferences ] 89 | then 90 | cd "${HOME}"/Library/Preferences 91 | HITOOLBOX_FILES=`find . -name "com.apple.HIToolbox.*plist"` 92 | for HITOOLBOX_FILE in ${HITOOLBOX_FILES} 93 | do 94 | update_kdb_layout "${HITOOLBOX_FILE}" "${KEYBOARDNAME}" "${KEYBOARDCODE}" 95 | done 96 | fi 97 | done 98 | 99 | # Set the computer language 100 | update_language "/Library/Preferences/.GlobalPreferences.plist" "${LANG}" 101 | 102 | for HOME in /Users/* 103 | do 104 | if [ -d "${HOME}"/Library/Preferences ] 105 | then 106 | cd "${HOME}"/Library/Preferences 107 | GLOBALPREFERENCES_FILES=`find . -name "\.GlobalPreferences.*plist"` 108 | for GLOBALPREFERENCES_FILE in ${GLOBALPREFERENCES_FILES} 109 | do 110 | update_language "${GLOBALPREFERENCES_FILE}" "${LANG}" 111 | done 112 | fi 113 | done 114 | 115 | # Set the region 116 | update_region "/Library/Preferences/.GlobalPreferences.plist" "${REGION}" 117 | 118 | for HOME in /Users/* 119 | do 120 | if [ -d "${HOME}"/Library/Preferences ] 121 | then 122 | cd "${HOME}"/Library/Preferences 123 | GLOBALPREFERENCES_FILES=`find . -name "\.GlobalPreferences.*plist"` 124 | for GLOBALPREFERENCES_FILE in ${GLOBALPREFERENCES_FILES} 125 | do 126 | update_region "${GLOBALPREFERENCES_FILE}" "${REGION}" 127 | done 128 | fi 129 | done 130 | 131 | # Create a local admin user account 132 | sysadminctl -addUser $LOCAL_ADMIN_SHORTNAME -fullName "$LOCAL_ADMIN_FULLNAME" -password "$LOCAL_ADMIN_PASSWORD" -admin 133 | dscl . create /Users/$LOCAL_ADMIN_SHORTNAME IsHidden 1 # Hides the account (10.10 and above) 134 | mv /Users/$LOCAL_ADMIN_SHORTNAME /var/$LOCAL_ADMIN_SHORTNAME # Moves the admin home folder to /var 135 | dscl . -create /Users/$LOCAL_ADMIN_SHORTNAME NFSHomeDirectory /var/$LOCAL_ADMIN_SHORTNAME # Create new home dir attribute 136 | dscl . -delete "/SharePoints/$LOCAL_ADMIN_FULLNAME's Public Folder" # Removes the public folder sharepoint for the local admin 137 | 138 | # Supress first run screens at login (iCloud, Siri & Diagnostics) 139 | for USER_TEMPLATE in "/System/Library/User Template"/* 140 | do 141 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant DidSeeCloudSetup -bool TRUE 142 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant GestureMovieSeen none 143 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant DidSeeSiriSetup -bool TRUE 144 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant LastSeenCloudProductVersion "${SW_VERS}" 145 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant LastSeenCloudProductVersion "${SW_VERS}" 146 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant LastSeenBuddyBuildVersion "${BUILD_VERS}" 147 | done 148 | 149 | # Disable diagnostics pop-up on 10.10 and above 150 | 151 | if [ ! -d "${CRASHREPORTER_SUPPORT}" ]; then 152 | mkdir "${CRASHREPORTER_SUPPORT}" 153 | chmod 775 "${CRASHREPORTER_SUPPORT}" 154 | chown root:admin "${CRASHREPORTER_SUPPORT}" 155 | fi 156 | 157 | for key in AutoSubmit AutoSubmitVersion ThirdPartyDataSubmit ThirdPartyDataSubmitVersion; do 158 | $PLBUDDY -c "Delete :$key" "${CRASHREPORTER_DIAG_PLIST}" 2> /dev/null 159 | done 160 | 161 | $PLBUDDY -c "Add :AutoSubmit bool ${SUBMIT_TO_APPLE}" "${CRASHREPORTER_DIAG_PLIST}" 162 | $PLBUDDY -c "Add :AutoSubmitVersion integer 4" "${CRASHREPORTER_DIAG_PLIST}" 163 | $PLBUDDY -c "Add :ThirdPartyDataSubmit bool ${SUBMIT_TO_APP_DEVELOPERS}" "${CRASHREPORTER_DIAG_PLIST}" 164 | $PLBUDDY -c "Add :ThirdPartyDataSubmitVersion integer 4" "${CRASHREPORTER_DIAG_PLIST}" 165 | 166 | # Set the time zone to London 167 | /usr/sbin/systemsetup -settimezone "Europe/London" 168 | 169 | # Enable network time servers 170 | /usr/sbin/systemsetup -setusingnetworktime on 171 | 172 | # Configure a specific NTP server 173 | /usr/sbin/systemsetup -setnetworktimeserver "time.euro.apple.com" 174 | 175 | # Switch on Apple Remote Desktop 176 | $ARD -configure -activate 177 | 178 | # Configure ARD access for the local admin user 179 | $ARD -configure -access -on 180 | $ARD -configure -allowAccessFor -specifiedUsers 181 | $ARD -configure -access -on -users $LOCAL_ADMIN_SHORTNAME -privs -all 182 | 183 | # Enable SSH 184 | systemsetup -setremotelogin on 185 | 186 | # Configure Login Window to username and password text fields 187 | /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow SHOWFULLNAME -bool true 188 | 189 | # Enable admin info at the Login Window 190 | /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName 191 | 192 | # Show input menu in Login Window 193 | /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow showInputMenu 1 194 | 195 | # Disable External Accounts at the Login Window 196 | /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow EnableExternalAccounts -bool false 197 | 198 | # Flush the JAMF policy history for this computer 199 | jamf flushPolicyHistory 200 | 201 | exit 0 202 | -------------------------------------------------------------------------------- /first_boot/10.9_firstBoot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Created by Amsys 4 | # 5 | # Use at your own risk. Amsys will accept 6 | # no responsibility for loss or damage 7 | # caused by this script. 8 | 9 | # Requires 10.9 or higher. 10 | 11 | ############### 12 | ## variables ## 13 | ############### 14 | PLBUDDY=/usr/libexec/PlistBuddy 15 | HOMEPAGE="www.google.co.uk" 16 | KEYBOARDNAME="British" 17 | KEYBOARDCODE="2" 18 | LANG="en" 19 | REGION="en_GB" 20 | ARD="/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart" 21 | #SUBMIT_TO_APPLE=NO 22 | #SUBMIT_TO_APP_DEVELOPERS=NO 23 | ORGNAME="CHA" 24 | 25 | ############################################################## 26 | ######### Advanced Modification Only Below This Line ######### 27 | ############################################################## 28 | 29 | sleep 120 30 | CONFIGPATH=/Library/$ORGNAME 31 | mkdir -p $CONFIGPATH 32 | 33 | ############### 34 | ## functions ## 35 | ############### 36 | 37 | update_kdb_layout() { 38 | ${PLBUDDY} -c "Delete :AppleCurrentKeyboardLayoutInputSourceID" "${1}" &>/dev/null 39 | if [ ${?} -eq 0 ] 40 | then 41 | ${PLBUDDY} -c "Add :AppleCurrentKeyboardLayoutInputSourceID string com.apple.keylayout.${KEYBOARDNAME}" "${1}" 42 | fi 43 | 44 | for SOURCE in AppleDefaultAsciiInputSource AppleCurrentAsciiInputSource AppleCurrentInputSource AppleEnabledInputSources AppleSelectedInputSources 45 | do 46 | ${PLBUDDY} -c "Delete :${SOURCE}" "${1}" &>/dev/null 47 | if [ ${?} -eq 0 ] 48 | then 49 | ${PLBUDDY} -c "Add :${SOURCE} array" "${1}" 50 | ${PLBUDDY} -c "Add :${SOURCE}:0 dict" "${1}" 51 | ${PLBUDDY} -c "Add :${SOURCE}:0:InputSourceKind string 'Keyboard Layout'" "${1}" 52 | ${PLBUDDY} -c "Add :${SOURCE}:0:KeyboardLayout\ ID integer ${KEYBOARDCODE}" "${1}" 53 | ${PLBUDDY} -c "Add :${SOURCE}:0:KeyboardLayout\ Name string '${KEYBOARDNAME}'" "${1}" 54 | fi 55 | done 56 | } 57 | 58 | update_language() { 59 | ${PLBUDDY} -c "Delete :AppleLanguages" "${1}" &>/dev/null 60 | if [ ${?} -eq 0 ] 61 | then 62 | ${PLBUDDY} -c "Add :AppleLanguages array" "${1}" 63 | ${PLBUDDY} -c "Add :AppleLanguages:0 string '${LANG}'" "${1}" 64 | fi 65 | } 66 | 67 | update_region() { 68 | ${PLBUDDY} -c "Delete :AppleLocale" "${1}" &>/dev/null 69 | ${PLBUDDY} -c "Add :AppleLocale string ${REGION}" "${1}" &>/dev/null 70 | ${PLBUDDY} -c "Delete :Country" "${1}" &>/dev/null 71 | ${PLBUDDY} -c "Add :Country string ${REGION:3:2}" "${1}" &>/dev/null 72 | } 73 | 74 | 75 | ##################### 76 | ## Script Commands ## 77 | ##################### 78 | 79 | # Create a local admin user account 80 | sudo jamf policy -event CreateAdminUser 81 | 82 | # Set the time zone to London 83 | /usr/sbin/systemsetup -settimezone "Europe/London" 84 | 85 | # Enable network time servers 86 | /usr/sbin/systemsetup -setusingnetworktime on 87 | 88 | # Configure a specific NTP server 89 | /usr/sbin/systemsetup -setnetworktimeserver "chea.org.uk" 90 | 91 | # Change Keyboard Layout 92 | update_kdb_layout "/Library/Preferences/com.apple.HIToolbox.plist" "${KEYBOARDNAME}" "${KEYBOARDCODE}" 93 | 94 | for HOME in /Users/* 95 | do 96 | if [ -d "${HOME}"/Library/Preferences ] 97 | then 98 | cd "${HOME}"/Library/Preferences 99 | HITOOLBOX_FILES=`find . -name "com.apple.HIToolbox.*plist"` 100 | for HITOOLBOX_FILE in ${HITOOLBOX_FILES} 101 | do 102 | update_kdb_layout "${HITOOLBOX_FILE}" "${KEYBOARDNAME}" "${KEYBOARDCODE}" 103 | done 104 | fi 105 | done 106 | 107 | # Set the computer language 108 | update_language "/Library/Preferences/.GlobalPreferences.plist" "${LANG}" 109 | 110 | for HOME in /Users/* 111 | do 112 | if [ -d "${HOME}"/Library/Preferences ] 113 | then 114 | cd "${HOME}"/Library/Preferences 115 | GLOBALPREFERENCES_FILES=`find . -name "\.GlobalPreferences.*plist"` 116 | for GLOBALPREFERENCES_FILE in ${GLOBALPREFERENCES_FILES} 117 | do 118 | update_language "${GLOBALPREFERENCES_FILE}" "${LANG}" 119 | done 120 | fi 121 | done 122 | 123 | # Set the region 124 | update_region "/Library/Preferences/.GlobalPreferences.plist" "${REGION}" 125 | 126 | for HOME in /Users/* 127 | do 128 | if [ -d "${HOME}"/Library/Preferences ] 129 | then 130 | cd "${HOME}"/Library/Preferences 131 | GLOBALPREFERENCES_FILES=`find . -name "\.GlobalPreferences.*plist"` 132 | for GLOBALPREFERENCES_FILE in ${GLOBALPREFERENCES_FILES} 133 | do 134 | update_region "${GLOBALPREFERENCES_FILE}" "${REGION}" 135 | done 136 | fi 137 | done 138 | 139 | # Switch on Apple Remote Desktop 140 | $ARD -configure -activate 141 | 142 | # Configure ARD access for the localadmin user 143 | $ARD -configure -access -on 144 | $ARD -configure -allowAccessFor -specifiedUsers 145 | $ARD -configure -access -on -users administrator -privs -all 146 | $ARD -configure -access -on -users _jssadm -privs -all 147 | 148 | 149 | # Enable SSH 150 | systemsetup -setremotelogin on 151 | 152 | # Configure Login Window to username and password text fields 153 | /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow SHOWFULLNAME -bool true 154 | 155 | # Enable admin info at the Login Window 156 | /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName 157 | 158 | # Disable External Accounts at the Login Window 159 | /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow EnableExternalAccounts -bool false 160 | 161 | # Disable iCloud for logging in users 162 | osvers=$(sw_vers -productVersion | awk -F. '{print $2}') 163 | sw_vers=$(sw_vers -productVersion) 164 | 165 | for USER_TEMPLATE in "/System/Library/User Template"/* 166 | do 167 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant DidSeeCloudSetup -bool TRUE 168 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant GestureMovieSeen none 169 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant LastSeenCloudProductVersion "${sw_vers}" 170 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.SetupAssistant LastSeenBuddyBuildVersion "${sw_build}" 171 | done 172 | 173 | for USER_HOME in /Users/* 174 | do 175 | USER_UID=`basename "${USER_HOME}"` 176 | if [ ! "${USER_UID}" = "Shared" ] 177 | then 178 | if [ ! -d "${USER_HOME}"/Library/Preferences ] 179 | then 180 | mkdir -p "${USER_HOME}"/Library/Preferences 181 | chown "${USER_UID}" "${USER_HOME}"/Library 182 | chown "${USER_UID}" "${USER_HOME}"/Library/Preferences 183 | fi 184 | if [ -d "${USER_HOME}"/Library/Preferences ] 185 | then 186 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.SetupAssistant DidSeeCloudSetup -bool TRUE 187 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.SetupAssistant GestureMovieSeen none 188 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.SetupAssistant LastSeenCloudProductVersion "${sw_vers}" 189 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.SetupAssistant LastSeenBuddyBuildVersion "${sw_build}" 190 | chown "${USER_UID}" "${USER_HOME}"/Library/Preferences/com.apple.SetupAssistant.plist 191 | fi 192 | fi 193 | done 194 | 195 | # Disable diagnostics at login 196 | if [ $osvers -ge 10 ]; then 197 | CRASHREPORTER_SUPPORT="/Library/Application Support/CrashReporter" 198 | CRASHREPORTER_DIAG_PLIST="${CRASHREPORTER_SUPPORT}/DiagnosticMessagesHistory.plist" 199 | 200 | if [ ! -d "${CRASHREPORTER_SUPPORT}" ]; then 201 | mkdir "${CRASHREPORTER_SUPPORT}" 202 | chmod 775 "${CRASHREPORTER_SUPPORT}" 203 | chown root:admin "${CRASHREPORTER_SUPPORT}" 204 | fi 205 | 206 | for key in AutoSubmit AutoSubmitVersion ThirdPartyDataSubmit ThirdPartyDataSubmitVersion; do 207 | $PlistBuddy -c "Delete :$key" "${CRASHREPORTER_DIAG_PLIST}" 2> /dev/null 208 | done 209 | 210 | $PlistBuddy -c "Add :AutoSubmit bool ${SUBMIT_TO_APPLE}" "${CRASHREPORTER_DIAG_PLIST}" 211 | $PlistBuddy -c "Add :AutoSubmitVersion integer 4" "${CRASHREPORTER_DIAG_PLIST}" 212 | $PlistBuddy -c "Add :ThirdPartyDataSubmit bool ${SUBMIT_TO_APP_DEVELOPERS}" "${CRASHREPORTER_DIAG_PLIST}" 213 | $PlistBuddy -c "Add :ThirdPartyDataSubmitVersion integer 4" "${CRASHREPORTER_DIAG_PLIST}" 214 | fi 215 | 216 | # Disable Time Machine Popups offering for new disks 217 | /usr/bin/defaults write /Library/Preferences/com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true 218 | 219 | # Turn off Gatekeeper 220 | spctl --master-disable 221 | 222 | # stop dock fixup messing up the dock 223 | mv -f /Library/Preferences/com.apple.dockfixup.plist{,.applefresh} 224 | 225 | # Disable softwareupdate schedule via a daemon 226 | defaults write /Library/LaunchDaemons/org.softwareupdate Label org.softwareupdate 227 | defaults write /Library/LaunchDaemons/org.softwareupdate LaunchOnlyOnce -bool TRUE 228 | defaults write /Library/LaunchDaemons/org.softwareupdate Program "/usr/sbin/softwareupdate" 229 | defaults write /Library/LaunchDaemons/org.softwareupdate RunAtLoad -bool TRUE 230 | defaults write /Library/LaunchDaemons/org.softwareupdate ProgramArguments -array "/usr/sbin/softwareupdate" "--schedule" "off" 231 | writelog "Disable softwareupdate: "$? echotolog 232 | /usr/sbin/chown root:wheel "/Library/LaunchDaemons/org.softwareupdate.plist" 233 | /bin/chmod 644 "/Library/LaunchDaemons/org.softwareupdate.plist" 234 | 235 | # expand printer dialog and save dialog by default. Also disable resume 236 | for USER_TEMPLATE in "/System/Library/User Template"/* 237 | do 238 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/.GlobalPreferences PMPrintingExpandedStateForPrint -bool YES 239 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/.GlobalPreferences NSNavPanelExpandedStateForSaveMode -bool YES 240 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.loginwindow TALLogoutSavesState -bool false 241 | done 242 | 243 | for USER_HOME in /Users/* 244 | do 245 | USER_UID=`basename "${USER_HOME}"` 246 | if [ ! "${USER_UID}" = "Shared" ] 247 | then 248 | if [ ! -d "${USER_HOME}"/Library/Preferences ] 249 | then 250 | mkdir -p "${USER_HOME}"/Library/Preferences 251 | chown "${USER_UID}" "${USER_HOME}"/Library 252 | chown "${USER_UID}" "${USER_HOME}"/Library/Preferences 253 | fi 254 | if [ -d "${USER_HOME}"/Library/Preferences ] 255 | then 256 | killall -u $USER_UID cfprefsd 257 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/.GlobalPreferences PMPrintingExpandedStateForPrint -bool YES 258 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/.GlobalPreferences NSNavPanelExpandedStateForSaveMode -bool YES 259 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.loginwindow TALLogoutSavesState -bool false 260 | fi 261 | fi 262 | done 263 | 264 | # Turn on right-click for mouse and trackpad 265 | for USER_TEMPLATE in "/System/Library/User Template"/* 266 | do 267 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.driver.AppleHIDMouse Button2 -int 2 268 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.driver.AppleBluetoothMultitouch.mouse MouseButtonMode -string TwoButton 269 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -int 1 270 | done 271 | 272 | for USER_HOME in /Users/* 273 | do 274 | USER_UID=`basename "${USER_HOME}"` 275 | if [ ! "${USER_UID}" = "Shared" ] 276 | then 277 | if [ ! -d "${USER_HOME}"/Library/Preferences ] 278 | then 279 | mkdir -p "${USER_HOME}"/Library/Preferences 280 | chown "${USER_UID}" "${USER_HOME}"/Library 281 | chown "${USER_UID}" "${USER_HOME}"/Library/Preferences 282 | fi 283 | if [ -d "${USER_HOME}"/Library/Preferences ] 284 | then 285 | killall -u $USER_UID cfprefsd 286 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.driver.AppleHIDMouse Button2 -int 2 287 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.driver.AppleBluetoothMultitouch.mouse MouseButtonMode -string TwoButton 288 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -int 1 289 | fi 290 | fi 291 | done 292 | 293 | # Turn off restore windows 294 | for USER_TEMPLATE in "/System/Library/User Template"/* 295 | do 296 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/ .GlobalPreferences" NSQuitAlwaysKeepsWindows -boolean FALSE 297 | done 298 | 299 | for USER_HOME in /Users/* 300 | do 301 | USER_UID=`basename "${USER_HOME}"` 302 | if [ ! "${USER_UID}" = "Shared" ] 303 | then 304 | if [ ! -d "${USER_HOME}"/Library/Preferences ] 305 | then 306 | mkdir -p "${USER_HOME}"/Library/Preferences 307 | chown "${USER_UID}" "${USER_HOME}"/Library 308 | chown "${USER_UID}" "${USER_HOME}"/Library/Preferences 309 | fi 310 | if [ -d "${USER_HOME}"/Library/Preferences ] 311 | then 312 | killall -u $USER_UID cfprefsd 313 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/ .GlobalPreferences" NSQuitAlwaysKeepsWindows -boolean FALSE 314 | fi 315 | fi 316 | done 317 | 318 | # Stop writing .DS_Store files on the network 319 | for USER_TEMPLATE in "/System/Library/User Template"/* 320 | do 321 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/.GlobalPreferences DSDontWriteNetworkStores -bool TRUE 322 | done 323 | 324 | for USER_HOME in /Users/* 325 | do 326 | USER_UID=`basename "${USER_HOME}"` 327 | if [ ! "${USER_UID}" = "Shared" ] 328 | then 329 | if [ ! -d "${USER_HOME}"/Library/Preferences ] 330 | then 331 | mkdir -p "${USER_HOME}"/Library/Preferences 332 | chown "${USER_UID}" "${USER_HOME}"/Library 333 | chown "${USER_UID}" "${USER_HOME}"/Library/Preferences 334 | fi 335 | if [ -d "${USER_HOME}"/Library/Preferences ] 336 | then 337 | killall -u $USER_UID cfprefsd 338 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/.GlobalPreferences DSDontWriteNetworkStores -bool TRUE 339 | fi 340 | fi 341 | done 342 | 343 | # Set the Users Homepage 344 | for USER_TEMPLATE in "/System/Library/User Template"/* 345 | do 346 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.Safari.plist HomePage -string "$HOMEPAGE" 347 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.Safari.plist NewTabBehavior -integer 0 348 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.Safari.plist NewWindowBehavior -integer 0 349 | done 350 | 351 | for USER_HOME in /Users/* 352 | do 353 | USER_UID=`basename "${USER_HOME}"` 354 | if [ ! "${USER_UID}" = "Shared" ] 355 | then 356 | if [ ! -d "${USER_HOME}"/Library/Preferences ] 357 | then 358 | mkdir -p "${USER_HOME}"/Library/Preferences 359 | chown "${USER_UID}" "${USER_HOME}"/Library 360 | chown "${USER_UID}" "${USER_HOME}"/Library/Preferences 361 | fi 362 | if [ -d "${USER_HOME}"/Library/Preferences ] 363 | then 364 | echo "Working on home folder preference file: ${USER_HOME}/Library/Preferences/com.apple.Safari.plist" 365 | mv "${USER_HOME}"/Library/Preferences/com.apple.Safari.plist "${USER_HOME}"/Library/Preferences/com.apple.Safari.plist_bak 366 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.Safari.plist HomePage -string "$HOMEPAGE" 367 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.Safari.plist NewTabBehavior -integer 0 368 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.Safari.plist NewWindowBehavior -integer 0 369 | chown $USER_UID "${USER_HOME}"/Library/Preferences/com.apple.Safari.plist 370 | fi 371 | fi 372 | done 373 | 374 | # Create a local admin home folder 375 | cp /System/Library/User\ Template/English.lproj /var/ 376 | mv /var/English.lproj /var/administrator 377 | chown -R administrator /var/administrator 378 | 379 | killall cfprefsd 380 | 381 | exit 0 -------------------------------------------------------------------------------- /in-placeUpgrade_high_sierra.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | "/Applications/Install macOS High Sierra.app/Contents/Resources/startosinstall" --applicationpath "/Applications/Install macOS High Sierra.app" --volume / --nointeraction 3 | -------------------------------------------------------------------------------- /issueNewFileVaultRecoveryKey.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Author: Stephen Bygrave - moof IT 4 | # Name: issueNewFileVaultRecoveryKey.sh 5 | # 6 | # Purpose: This script changes the recovery key for the current logged in user 7 | # Usage: Jamf Pro policy 8 | # 9 | # Version 1.0.0, 2017-12-30 10 | # SB - Initial Creation 11 | # Version 1.1.0, 2018-04-18 12 | # SB - Changes to AppleScript and cosmetics 13 | # Version 1.1.1, 2018-04-19 14 | # SB - Changes to error reporting 15 | 16 | # Use at your own risk. Amsys will accept no responsibility for loss or damage 17 | # caused by this script. 18 | 19 | ##### Set variables 20 | 21 | logProcess="issueNewFileVaultRecoveryKey" 22 | userName=$(python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");') 23 | userNameUUID=$(dscl . -read /Users/${userName}/ GeneratedUID | awk '{print $2}') 24 | OS=`/usr/bin/sw_vers -productVersion | awk -F. {'print $2'}` 25 | userCheck=`/usr/bin/fdesetup list | awk -v usrN="$userNameUUID" -F, 'match($0, usrN) {print $1}'` 26 | 27 | ##### Declare functions 28 | 29 | writelog () 30 | { 31 | /usr/bin/logger -is -t "${logProcess}" "${1}" 32 | if [[ -e "/var/log/jamf.log" ]]; 33 | then 34 | echo "$(date +"%a %b %d %T") $(hostname -f | awk -F "." '{print $1}') jamf[${logProcess}]: ${1}" >> "/var/log/jamf.log" 35 | fi 36 | } 37 | 38 | echoVariables () 39 | { 40 | writelog "Log Process is ${logProcess}" 41 | writelog "User is ${userName}" 42 | writelog "UUID is ${userNameUUID}" 43 | writelog "OS is ${OS}" 44 | } 45 | 46 | checkForFV () 47 | { 48 | ## This first user check sees if the logged in account is already authorized with FileVault 2 49 | if [[ "${userCheck}" != "${userName}" ]]; 50 | then 51 | writelog "This user is not a FileVault enabled user." 52 | exit 3 53 | else 54 | writelog "User is enabled for FileVault. Continuing..." 55 | fi 56 | } 57 | 58 | checkForFVComplete () 59 | { 60 | ## Check to see if the encryption process is complete 61 | encryptCheck=$(/usr/bin/fdesetup status) 62 | statusCheck=$(echo "${encryptCheck}" | grep "FileVault is On.") 63 | expectedStatus="FileVault is On." 64 | if [[ "${statusCheck}" != "${expectedStatus}" ]]; 65 | then 66 | writelog "The encryption process has not completed: ${encryptCheck}" 67 | exit 4 68 | fi 69 | } 70 | 71 | grabUserPass () 72 | { 73 | ## Get the logged in user's password via a prompt 74 | writelog "Prompting ${userName} for their login password." 75 | userPass=$(/usr/bin/osascript -e "set myUserPass to text returned of (display dialog \"Your FileVault key is invalid. Please enter your login password to create a new one:\" default answer \"\" with title \"Login Password\" buttons {\"OK\"} default button 1 with hidden answer)") 76 | } 77 | 78 | issueRecoveryKey () 79 | { 80 | writelog "Issuing new recovery key" 81 | 82 | if [[ "${OS}" -ge 9 ]]; 83 | then 84 | ## This "expect" block will populate answers for the fdesetup prompts that normally occur while hiding them from output 85 | fvKeyRotateStatus=$(expect -c " 86 | log_user 0 87 | spawn /usr/bin/fdesetup changerecovery -personal 88 | expect \"Enter the user name:\" 89 | send {${userName}} 90 | send \r 91 | expect \"Enter the password for user {${userName}}:\" 92 | send {${userPass}} 93 | send \r 94 | log_user 1 95 | expect eof 96 | ") 97 | if [[ "${fvKeyRotateStatus}" =~ .*New\ personal\ recovery\ key.* ]] 98 | then 99 | writelog "FileVault recovery key rotated successfully." 100 | else 101 | writelog "Unable to rotate FileVault recovery key, error: ${fvKeyRotateStatus}" 102 | fi 103 | else 104 | writelog "OS version not 10.9+ or OS version unrecognized: $(/usr/bin/sw_vers -productVersion)" 105 | exit 5 106 | fi 107 | sleep 60 108 | /usr/local/bin/jamf recon 109 | } 110 | 111 | ##### Run script 112 | echoVariables 113 | checkForFV 114 | checkForFVComplete 115 | grabUserPass 116 | issueRecoveryKey 117 | 118 | writelog "Script completed." 119 | -------------------------------------------------------------------------------- /macOS/Software Updates/EA - List_Configuration_Data_Updates.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ######################################################################################### 4 | # Author: Darren Wallace - Moof IT 5 | # Name: EA - List_Configuration_Data_Updates.sh 6 | # 7 | # Purpose: This script uses the undocumented '--include-config-data' flag for 8 | # softwareupdate to list these updates ready for an EA. 9 | # This includes data for Apple's GateKeeper, X Protect and Malware 10 | # Removal Tool 11 | # *NOTE*: This only works on 10.12.x or newer. 12 | # *NOTE 2: This has only been tested on 10.12.6 (16G29) and 10.11.x 13 | # Usage: CLI 14 | # 15 | # Version 2018.01.22 - DW - Initial Creation 16 | # 17 | ######################################################################################### 18 | # 19 | # Copyright (c) 2018, Moof IT Ltd. All rights reserved. 20 | # 21 | # Redistribution and use in source and binary forms, with or without 22 | # modification, are permitted provided that the following conditions are met: 23 | # * Redistributions of source code must retain the above copyright 24 | # notice, this list of conditions and the following disclaimer. 25 | # * Redistributions in binary form must reproduce the above copyright 26 | # notice, this list of conditions and the following disclaimer in the 27 | # documentation and/or other materials provided with the distribution. 28 | # * Neither Moof IT Ltd nor the 29 | # names of its contributors may be used to endorse or promote products 30 | # derived from this software without specific prior written permission. 31 | # 32 | # THIS SOFTWARE IS PROVIDED BY Moof IT LTD "AS IS" AND ANY 33 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 34 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 35 | # DISCLAIMED. IN NO EVENT SHALL Moof IT LTD BE LIABLE FOR ANY 36 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 37 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 38 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 39 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 40 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 41 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 42 | # 43 | ######################################################################################### 44 | # 45 | # SUPPORT FOR THIS PROGRAM 46 | # 47 | # This program is distributed "as is" by Moof IT Ltd. 48 | # For more information or support, please utilise the following resources: 49 | # 50 | # http://www.moof-it.co.uk 51 | # 52 | ######################################################################################### 53 | 54 | ##################################### Set variables ##################################### 55 | 56 | # Name of the script 57 | scriptName="EA - List_Configuration_Data_Updates" 58 | 59 | ################################## Declare functions #################################### 60 | 61 | # Function to check the OS is 10.12.x or newer 62 | checkOS () 63 | { 64 | /bin/echo "Checking OS Version..." 65 | osvers=$(/usr/bin/sw_vers -productVersion | /usr/bin/awk -F. '{print $2}') 66 | if [[ ${osvers} -ge 12 ]]; 67 | then 68 | /bin/echo "OS Version is 10.12 or newer, proceeding..." 69 | else 70 | /bin/echo "OS Version is 10.11 or older and this script will not work." 71 | result="N/A" 72 | /bin/echo "${result}" 73 | exit 0 74 | fi 75 | } 76 | 77 | # Function to check and list all avalible config data updates 78 | checkForConfigData () 79 | { 80 | /bin/echo "Checking for Config Data updates" 81 | updatesFound=$(/usr/sbin/softwareupdate -l --include-config-data | /usr/bin/awk '/\*/ && /ConfigData/' | /usr/bin/sed 's/* //') 82 | if [ -z "${updatesFound}" ] || [[ "${updatesFound}" == "" ]]; 83 | then 84 | /bin/echo "No Config Data updates available." 85 | result="None" 86 | /bin/echo "${result}" 87 | exit 0 88 | else 89 | /bin/echo "Config Data updates found:" 90 | /bin/echo "${updatesFound}" 91 | result="${updatesFound}" 92 | /bin/echo "${result}" 93 | fi 94 | } 95 | 96 | ##################################### Run Script ####################################### 97 | 98 | # Check the running OS to ensure it's at least 10.12 or newer 99 | checkOS 100 | # Run the undocumented flag for softwareupdate and parse the output 101 | checkForConfigData 102 | 103 | /bin/echo "ERROR: Unexpected script exit" 104 | exit 2 105 | -------------------------------------------------------------------------------- /macOS/Software Updates/Install_Configuration_Data_Updates.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ######################################################################################### 4 | # Author: Darren Wallace - Moof IT 5 | # Name: Install_Configuration_Data_Updates.sh 6 | # 7 | # Purpose: This script uses the undocumented '--include-config-data' flag for 8 | # softwareupdate to list and run these updates. 9 | # This includes data for Apple's GateKeeper, X Protect and Malware 10 | # Removal Tool 11 | # *NOTE*: This only works on 10.12.x or newer. 12 | # *NOTE 2: This has only been tested on 10.12.6 (16G29) and 10.11.x 13 | # Usage: CLI 14 | # 15 | # Version 2018.01.22 - DW - Typo fix, minor pruning and switch to Moof IT! 16 | # 2017.09.11 - DW - Initial Creation 17 | # 18 | ######################################################################################### 19 | # 20 | # Copyright (c) 2018, Moof IT Ltd. All rights reserved. 21 | # 22 | # Redistribution and use in source and binary forms, with or without 23 | # modification, are permitted provided that the following conditions are met: 24 | # * Redistributions of source code must retain the above copyright 25 | # notice, this list of conditions and the following disclaimer. 26 | # * Redistributions in binary form must reproduce the above copyright 27 | # notice, this list of conditions and the following disclaimer in the 28 | # documentation and/or other materials provided with the distribution. 29 | # * Neither Moof IT Ltd nor the 30 | # names of its contributors may be used to endorse or promote products 31 | # derived from this software without specific prior written permission. 32 | # 33 | # THIS SOFTWARE IS PROVIDED BY Moof IT LTD "AS IS" AND ANY 34 | # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 35 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 36 | # DISCLAIMED. IN NO EVENT SHALL Moof IT LTD BE LIABLE FOR ANY 37 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 38 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 39 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 40 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 41 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 42 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 43 | # 44 | ######################################################################################### 45 | # 46 | # SUPPORT FOR THIS PROGRAM 47 | # 48 | # This program is distributed "as is" by Moof IT LTD. 49 | # For more information or support, please utilise the following resources: 50 | # 51 | # http://www.moof-it.co.uk 52 | # 53 | ######################################################################################### 54 | 55 | ##################################### Set variables ##################################### 56 | 57 | # Name of the script 58 | scriptName="Install_Configuration_Data_Updates" 59 | 60 | # Location of the LogFile to save output to 61 | logFile="/Library/Logs/${scriptName}.log" 62 | 63 | ################################## Declare functions #################################### 64 | 65 | # Function to write input to the terminal and a logfile 66 | writeLog () 67 | { 68 | /bin/echo "$(date) - ${1}" 69 | /bin/echo "$(date) - ${1}" >> "${logFile}" 70 | } 71 | 72 | # Function to check the OS is 10.12.x or newer 73 | checkOS () 74 | { 75 | writeLog "Checking OS Version..." 76 | osvers=$(/usr/bin/sw_vers -productVersion | /usr/bin/awk -F. '{print $2}') 77 | if [[ ${osvers} -ge 12 ]]; 78 | then 79 | writeLog "OS Version is 10.12 or newer, proceeding..." 80 | else 81 | writeLog "OS Version is 10.11 or older and this script will not work." 82 | exit 0 83 | fi 84 | } 85 | 86 | # Function to check and list all avalible config data updates 87 | checkForConfigData () 88 | { 89 | writeLog "Checking for Config Data updates" 90 | updatesFound=$(/usr/sbin/softwareupdate -l --include-config-data | /usr/bin/awk '/\*/ && /ConfigData/' | /usr/bin/sed 's/* //') 91 | if [ -z "${updatesFound}" ] || [[ "${updatesFound}" == "" ]]; 92 | then 93 | writeLog "No Config Data updates available." 94 | exit 0 95 | else 96 | writeLog "Config Data updates found:" 97 | writeLog "${updatesFound}" 98 | fi 99 | } 100 | 101 | # Function to install all avalible config data updates 102 | installConfigData () 103 | { 104 | writeLog "Installing available Config Data updates..." 105 | updatesToInstall="${updatesFound} | tr -d '\n'" 106 | /usr/sbin/softwareupdate -i ${updatesFound} --include-config-data 107 | exitCode="${?}" 108 | if [[ "${exitCode}" != 0 ]]; 109 | then 110 | writeLog "ERROR: Error installing updates" 111 | writeLog "softwareupdate command error code ${?}" 112 | exit "${?}" 113 | else 114 | writeLog "Updates installed!" 115 | exit 0 116 | fi 117 | } 118 | 119 | ##################################### Run Script ####################################### 120 | 121 | # Check the running OS to ensure it's at least 10.12 or newer 122 | checkOS 123 | # Run the undocumented flag for softwareupdate and parse the output 124 | checkForConfigData 125 | # Same as above, except this time we'll install using it 126 | installConfigData 127 | 128 | writeLog "ERROR: Unexpected script exit" 129 | exit 2 130 | -------------------------------------------------------------------------------- /mount_SMBHome/README.txt: -------------------------------------------------------------------------------- 1 | This script will read the user's SMBHome attribute from AD and mount it. 2 | 3 | You can use the mount_protocol variable at the top of the script to change between afp & smb. 4 | 5 | The logfile can go wherever you like but make sure it is writable by the logging in users. 6 | -------------------------------------------------------------------------------- /mount_SMBHome/mounthome.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Created by Amsys 4 | # 5 | # Use at your own risk. Amsys will accept 6 | # no responsibility for loss or damage 7 | # caused by this script. 8 | 9 | ##### ADVANCED MODIFICATION ONY BELOW THIS LINE ##### 10 | 11 | # Create a log writing function 12 | writelog() 13 | { 14 | echo "${1}" 15 | } 16 | 17 | writelog "STARTING: User drive mount" 18 | 19 | # Already mounted check 20 | 21 | # The following checks confirm whether the user's personal network drive is already mounted, 22 | # (exiting if it is). If it is not already mounted, it checks if there is a mount point 23 | # already in /Volumes. If there is, it is deleted. 24 | 25 | isMounted=`mount | grep -c "/Volumes/$USER"` 26 | 27 | if [ $isMounted -ne 0 ] ; then 28 | writelog "Network share already mounted for $USER" 29 | exit 0 30 | fi 31 | 32 | # Mount network home 33 | writelog "Retrieving SMBHome attribute for $USER" 34 | 35 | # Get Domain from full structure, cut the name and remove space. 36 | ShortDomainName=`dscl /Active\ Directory/ -read . | grep SubNodes | sed 's|SubNodes: ||g'` 37 | 38 | # Find the user's SMBHome attribue, strip the leading \\ and swap the remaining \ in the path to / 39 | # The result is to turn smbhome: \\server.domain.com\path\to\home into server.domain.com/path/to/home 40 | adHome=$(dscl /Active\ Directory/$ShortDomainName/All\ Domains -read /Users/$USER SMBHome) 41 | if [ $? -ne 0 ] 42 | then 43 | writelog "ERROR: Cannot read ${USER}'s SMBHome attribute from '/Active Directory/$ShortDomainName/All Domains'. Exiting script." 44 | exit 1 45 | else 46 | adHome=$(echo "${adHome}" | sed 's|SMBHome:||g' | sed 's/^[\\]*//' | sed 's:\\:/:g' | sed 's/ \/\///g' | tr -d '\n' | sed 's/ /%20/g') 47 | fi 48 | 49 | # Next we perform a quick check to make sure that the SMBHome attribute is populated 50 | case "$adHome" in 51 | "" ) 52 | writelog "ERROR: ${USER}'s SMBHome attribute does not have a value set. Exiting script." 53 | exit 1 ;; 54 | * ) 55 | writelog "Active Directory users SMBHome attribute identified as $adHome" 56 | ;; 57 | esac 58 | 59 | # Mount the network home 60 | mount_script=`/usr/bin/osascript > /dev/null << EOT 61 | # tell application "Finder" 62 | # activate 63 | mount volume "smb://${adHome}" 64 | # end tell 65 | EOT` 66 | 67 | writelog "Script completed" 68 | # Script End 69 | 70 | exit 0 -------------------------------------------------------------------------------- /printerConnect.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Author: Stephen Bygrave - Moof IT 4 | # Name: printerConnect.sh 5 | # 6 | # Purpose: Assumes print drivers are installed on device; sets up a printer 7 | # using LPD with various options 8 | # Usage: Jamf Pro script 9 | # 10 | # Version 1.0.0, 2018-02-13 11 | # SB - Initial Creation 12 | 13 | # Use at your own risk. moof IT will accept no responsibility for loss or damage 14 | # caused by this script. 15 | 16 | ##### Set variables 17 | 18 | logProcess="printerConnect" 19 | printerName="${4}" # This is the name of the printer, e.g. MyGreatPrinter 20 | printerUrl="${5}" # This is the URL of the printer, e.g. ipp://fp01.ac.uk/printers/printer1 21 | ppd="${6}" # This is the path to the ppd file, e.g. /Library/Printers/PPDs/Contents/Resources/HP LaserJet 4000 Series.gz 22 | printerLocation="${7}" # This is the GUI location of the printer, e.g. Poland Street 23 | ssoPrinting="${8}" # Set this to 'Yes' to enable SSO printing 24 | additionalOptions="${10}" # This is a one line string of options that should be seperated with spaces, and an "-o" before each option 25 | 26 | ##### Declare functions 27 | 28 | writelog () 29 | { 30 | /usr/bin/logger -is -t "${logProcess}" "${1}" 31 | if [[ -e "/var/log/jamf.log" ]]; 32 | then 33 | /bin/echo "$(date +"%a %b %d %T") $(hostname -f | awk -F "." '{print $1}') jamf[${logProcess}]: ${1}" >> "/var/log/jamf.log" 34 | fi 35 | } 36 | 37 | echoVariables () 38 | { 39 | writelog "Log Process is ${logProcess}" 40 | writelog "Printer Name: ${printerName}" 41 | writelog "Printer URL: ${printerUrl}" 42 | writelog "PPD Location: ${ppd}" 43 | writelog "Printer Location: ${printerLocation}" 44 | writelog "SSO Printing: ${ssoPrinting}" 45 | } 46 | 47 | testForPrinter () 48 | { 49 | for printerCheck in $(/usr/bin/lpstat -p | awk '{print $2}'); 50 | do 51 | if [[ "${printerCheck}" == "${printerName}" ]]; 52 | then 53 | /usr/sbin/lpadmin -x "${printerName}" 54 | fi 55 | done 56 | } 57 | 58 | addPrinter () 59 | { 60 | if [[ "${ssoPrinting}" == "Yes" ]]; 61 | then 62 | /usr/sbin/lpadmin -p "${printerName}" -v "${printerUrl}" -L "${printerLocation}" -P "${ppd}" -D "${printerName}" -E -o printer-is-shared=false -o printer-error-policy="retry-current-job" -o auth-info-required=negotiate "${additionalOptions}" 63 | else 64 | /usr/sbin/lpadmin -p "${printerName}" -v "${printerUrl}" -L "${printerLocation}" -P "${ppd}" -D "${printerName}" -E -o printer-is-shared=false -o printer-error-policy="retry-current-job" "${additionalOptions}" 65 | fi 66 | } 67 | 68 | ##### Run script 69 | 70 | echoVariables 71 | testForPrinter 72 | addPrinter 73 | writelog "Script completed." 74 | 75 | -o PageSize=A4 76 | -------------------------------------------------------------------------------- /removeProfile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Author: Stephen Bygrave - Moof IT 4 | # Name: removeProfile.sh 5 | # 6 | # Purpose: Will remove a (or many) profile(s) from a Mac 7 | # Usage: Run in Terminal 8 | # 9 | # Version 1.0.0, 2018-05-24 10 | # SB - Initial Creation 11 | 12 | # Use at your own risk. Moof IT will accept no responsibility for loss or damage 13 | # caused by this script. 14 | 15 | ##### Set variables 16 | 17 | logProcess="removeProfile" 18 | profileName="MDM Profile" 19 | 20 | ##### Declare functions 21 | 22 | writelog () 23 | { 24 | /usr/bin/logger -is -t "${logProcess}" "${1}" 25 | } 26 | 27 | echoVariables () 28 | { 29 | writelog "Log Process is ${logProcess}" 30 | } 31 | 32 | ##### Run script 33 | 34 | echoVariables 35 | 36 | # Get UUID of requested MDM Profile 37 | mdmID=$(/usr/bin/profiles -Lv | grep "name: ${profileName}" -4 | awk -F": " '/attribute: profileIdentifier/{print $NF}') 38 | 39 | # Remove said profile, identified by UUID 40 | if [[ $"{mdmID}" ]]; 41 | then 42 | /usr/bin/profiles -R -p "${mdmID}" 43 | else 44 | echo "No Profile Found" 45 | fi 46 | 47 | writelog "Script completed." 48 | -------------------------------------------------------------------------------- /resetHomeOwnership/README.txt: -------------------------------------------------------------------------------- 1 | Resets owners recursively on folders in /Users on Mac OS X 2 | -------------------------------------------------------------------------------- /resetHomeOwnership/resetHomeOwner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ################################ 4 | # 5 | # Script to reset home folder ownership 6 | # 7 | # Created by David Acland - Amsys 8 | # 9 | # Use at your own risk. Amsys will accept 10 | # no responsibility for loss or damage 11 | # caused by this script. 12 | # 13 | ################################ 14 | 15 | counter=`ls /Users | grep -v -E 'Shared|Guest|.localized|.DS_Store' | grep -c "[A-z 0-9]"` 16 | # Outputs the number of folders in the /Users directory, excluding the Shared & Guest directories 17 | 18 | # Loop start 19 | 20 | while [ $counter -ne 0 ] 21 | do 22 | username=`ls /Users | grep -v -E 'Shared|Guest|.localized|.DS_Store' | grep "[A-z 0-9]" | head -$counter | tail -1` 23 | # Gets the target folder name (there’s probably a better way to do this but it works!) 24 | 25 | chown -R $username /Users/$username 26 | # Sets the folder owner 27 | 28 | counter=$(( $counter - 1 )) 29 | # Reduces the counter by 1 30 | done 31 | 32 | exit 0 -------------------------------------------------------------------------------- /set_safari_homepage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | HOMEPAGE="" 4 | 5 | # Set the users homepage for Safari and sets new windows and tabs to open to the homepage 6 | # User template 7 | if [ -z "$HOMEPAGE" ] 8 | then 9 | echo "No homepage value set" 10 | else 11 | for USER_TEMPLATE in "/System/Library/User Template"/* 12 | do 13 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.Safari.plist HomePage -string "$HOMEPAGE" 14 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.Safari.plist NewTabBehavior -integer 0 15 | /usr/bin/defaults write "${USER_TEMPLATE}"/Library/Preferences/com.apple.Safari.plist NewWindowBehavior -integer 0 16 | done 17 | 18 | # Existing users 19 | killall cfprefsd 20 | for USER_HOME in /Users/* 21 | do 22 | USER_UID=`basename "${USER_HOME}"` 23 | if [ ! "${USER_UID}" = "Shared" ] 24 | then 25 | if [ ! -d "${USER_HOME}"/Library/Preferences ] 26 | then 27 | mkdir -p "${USER_HOME}"/Library/Preferences 28 | chown "${USER_UID}" "${USER_HOME}"/Library 29 | chown "${USER_UID}" "${USER_HOME}"/Library/Preferences 30 | fi 31 | if [ -d "${USER_HOME}"/Library/Preferences ] 32 | then 33 | echo "Working on home folder preference file: ${USER_HOME}/Library/Preferences/com.apple.Safari.plist" 34 | mv "${USER_HOME}"/Library/Preferences/com.apple.Safari.plist "${USER_HOME}"/Library/Preferences/com.apple.Safari.plist_bak 35 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.Safari.plist HomePage -string "$HOMEPAGE" 36 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.Safari.plist NewTabBehavior -integer 0 37 | /usr/bin/defaults write "${USER_HOME}"/Library/Preferences/com.apple.Safari.plist NewWindowBehavior -integer 0 38 | chown $USER_UID "${USER_HOME}"/Library/Preferences/com.apple.Safari.plist 39 | fi 40 | fi 41 | done 42 | fi 43 | -------------------------------------------------------------------------------- /set_wallpaper/README.md: -------------------------------------------------------------------------------- 1 | This script can manually set the wallpaper in OS X. It uses osascript to set the background immediately for users that are logged in, then uses sqlite3 to set the same value into the desktoppicture.db of any other home folders in /Users. 2 | 3 | The only value you need to set will be the wallpaper variable at the top of the script. 4 | 5 | Don't forget to deploy the actual wallpaper file to the target Macs first! 6 | -------------------------------------------------------------------------------- /set_wallpaper/setWallpaper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | wallpaper="/Library/Desktop Pictures/your_picture.jpg" 4 | 5 | # Set the wallpaper imediately for logged in users 6 | osascript -e 'tell application "Finder" to set desktop picture to POSIX file "$wallpaper"' 7 | 8 | # Then set it for any other users that aren't logged in yet 9 | for USER_HOME in /Users/* 10 | do 11 | USER_UID=`basename "${USER_HOME}"` 12 | if [ ! "${USER_UID}" = "Shared" ] 13 | then 14 | if [ -d "${USER_HOME}"/Library/Application\ Support ] 15 | then 16 | /usr/bin/sqlite3 "${USER_HOME}"/Library/Application\ Support/Dock/desktoppicture.db "update data set value = '$wallpaper'" 17 | fi 18 | fi 19 | done 20 | 21 | exit 0 -------------------------------------------------------------------------------- /shareConnect.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Author: Stephen Bygrave - Moof IT 4 | # Name: shareConnect.sh 5 | # 6 | # Purpose: Mounts a share on login 7 | # Usage: Script in Jamf Pro policy 8 | # 9 | # Version 1.0.0, 2018-04-17 10 | # Initial Creation 11 | 12 | # Use at your own risk. moof IT will accept no responsibility for loss or damage 13 | # caused by this script. 14 | 15 | ##### Set variables 16 | 17 | logProcess="shareConnect" 18 | userName="${3}" 19 | protocol="${4}" 20 | serverName="${5}" 21 | shareName="${6}" 22 | 23 | ##### Declare functions 24 | 25 | writelog () 26 | { 27 | /usr/bin/logger -is -t "${logProcess}" "${1}" 28 | if [[ -e "/var/log/jamf.log" ]]; 29 | then 30 | /bin/echo "$(date +"%a %b %d %T") $(hostname -f | awk -F "." '{print $1}') jamf[${logProcess}]: ${1}" >> "/var/log/jamf.log" 31 | fi 32 | } 33 | 34 | echoVariables () 35 | { 36 | writelog "Log Process: ${logProcess}" 37 | writelog "User: ${userName}" 38 | writelog "Protocol: ${protocol}" 39 | writelog "Server: ${serverName}" 40 | writelog "Sharename: ${shareName}" 41 | } 42 | 43 | checkUsername () 44 | { 45 | # Checks if the username variable is empty (user running script from Self 46 | # Service) 47 | if [[ -z "${userName}" ]]; 48 | then 49 | userName=$(/usr/bin/python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");') 50 | fi 51 | } 52 | 53 | mountShare () 54 | { 55 | mount_script=`/usr/bin/osascript > /dev/null << EOT 56 | # tell application "Finder" 57 | activate 58 | mount volume "${protocol}://${serverName}/${shareName}" 59 | # end tell 60 | EOT` 61 | exitStatus="${?}" 62 | } 63 | 64 | ##### Run script 65 | 66 | echoVariables 67 | checkUsername 68 | mountShare 69 | 70 | writelog "Script completed." 71 | -------------------------------------------------------------------------------- /shareConnectGroupCheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Created by David Acland - Amsys 4 | # 5 | # Use at your own risk. Amsys will accept 6 | # no responsibility for loss or damage 7 | # caused by this script. 8 | 9 | username="$3" 10 | if [ -z "$username" ]; then # Checks if the variable is empty (user running script from Self Service) 11 | username="$USER" 12 | fi 13 | echo "User: $username" 14 | protocol="$4" # This is the protocol to connect with (afp | smb) 15 | echo "Protocol: $4" 16 | serverName="$5" # This is the address of the server, e.g. my.fileserver.com 17 | echo "Server: $5" 18 | shareName="$6" # This is the name of the share to mount 19 | echo "Sharename: $6" 20 | group="$7" # This is the name of the group the user needs to be a member of to mount the share 21 | echo "Group: $7" 22 | 23 | # Check that the user is in the necessary group 24 | groupCheck=`dseditgroup -o checkmember -m $username "$group" | grep -c "yes"` 25 | if [ "${groupCheck}" -ne 1 ]; then 26 | exit 1 27 | fi 28 | 29 | # Mount the drive 30 | mount_script=`/usr/bin/osascript > /dev/null << EOT 31 | tell application "Finder" 32 | activate 33 | mount volume "$protocol://${serverName}/${shareName}" 34 | end tell 35 | EOT` 36 | 37 | exit 0 38 | -------------------------------------------------------------------------------- /suppressUpdateCheckForVisualStudio.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ######################################################################################### 4 | # Author: Darren Wallace - Amsys 5 | # Name: suppressUpdateCheckForVisualStudio.sh 6 | # 7 | # Purpose: This script will a configuration file for Visual Studio to the 8 | # currently logged in user's Application Support folder. 9 | # The script will bail out if it detects 'root' or blank as the logged 10 | # in user. 11 | # Source: https://code.visualstudio.com/docs/supporting/FAQ#_how-do-i-opt-out-of-vs-code-autoupdates 12 | # Usage: CLI | Jamf Pro 13 | # 14 | # Version 2017.12.29 - DW - Initial Creation 15 | # 16 | ######################################################################################### 17 | 18 | ##################################### Set variables ##################################### 19 | 20 | # Name of the script 21 | scriptName="suppressUpdateCheckForVisualStudio.sh" 22 | # Name of the file 23 | fileName="settings.json" 24 | # Work out the currently logged in user 25 | loggedInUser=$(/usr/bin/python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");') 26 | # Work out the final destination for the file 27 | # This next line works out the user's home, even if working direct from a network volume (yuk) 28 | eval usersNetworkHome="~${loggedInUser}" 29 | # Path to the Directory 30 | directoryPath="${usersNetworkHome}/Library/Application Support/Code/User" 31 | # Final full path 32 | finalLocation="${directoryPath}/${fileName}" 33 | 34 | ##################################### Run Script ####################################### 35 | 36 | /bin/echo "$(date) Starting script: ${scriptName}" 37 | 38 | # Check if the current user is 'root' or blank 39 | if [[ "${loggedInUser}" == "root" ]]; then 40 | # Current user detected as root so we will exit 41 | /bin/echo "$(date) Current user detected as 'root', bailing out..." 42 | exit 0 43 | elif [[ "${loggedInUser}" == "" ]]; then 44 | # Current user detected as blank so we will exit 45 | /bin/echo "$(date) Current user detected as blank, bailing out..." 46 | exit 0 47 | fi 48 | 49 | # Current user detected correctly, so off we go 50 | /bin/echo "$(date) Saving file to: ${finalLocation}" 51 | 52 | # Create the directory if required 53 | if [[ -d "${directoryPath}" ]]; then 54 | /bin/echo "$(date) Directory already present, skipping" 55 | else 56 | /bin/echo "$(date) Directory not found, creating..." 57 | /bin/mkdir -p "${directoryPath}" 58 | /usr/sbin/chown -R "${loggedInUser}" "${usersNetworkHome}/Library/Application Support/Code" 59 | fi 60 | 61 | # Create the final file 62 | /bin/echo "$(date) Writing the file in place" 63 | 64 | /bin/echo "{ 65 | "update.channel": "none" 66 | }" > "${finalLocation}" 67 | 68 | # Permission the file correctly 69 | /usr/sbin/chown "${loggedInUser}" "${finalLocation}" 70 | 71 | /bin/echo "$(date) Script complete" 72 | 73 | ##################################### End Script ####################################### 74 | -------------------------------------------------------------------------------- /testswup: -------------------------------------------------------------------------------- 1 | update1 2 | update2 3 | update3 4 | -------------------------------------------------------------------------------- /uninstall_crashplan/uninstall_crashplan.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo | osascript <" > /private/tmp/Packages/$PACKAGE.xml 27 | echo " $PACKAGE" >> /private/tmp/Packages/$PACKAGE.xml 28 | echo " $PACKAGE" >> /private/tmp/Packages/$PACKAGE.xml 29 | echo " 10" >> /private/tmp/Packages/$PACKAGE.xml 30 | echo " false" >> /private/tmp/Packages/$PACKAGE.xml 31 | echo " true" >> /private/tmp/Packages/$PACKAGE.xml 32 | echo "" >> /private/tmp/Packages/$PACKAGE.xml 33 | 34 | curl -sfku $apiUser:$apiPass $apiURL/JSSResource/packages -T /private/tmp/Packages/$PACKAGE.xml -X POST 35 | 36 | done 37 | 38 | exit 0 --------------------------------------------------------------------------------