├── README.md ├── usr └── local │ └── outset │ ├── boot-once │ ├── LocationServices.sh │ └── DateTimeSettings.sh │ ├── login-every │ └── DockEvery.sh │ ├── login-once │ ├── OLD │ │ ├── MailSettings.sh │ │ ├── SafariSettings.sh │ │ └── MicrosoftAutoUpdate2.sh │ ├── DesktopPicture.sh │ ├── VPN-Menu.sh │ ├── MenuBarSettings.sh │ ├── FinderSettings.sh │ └── DockOnce.sh │ └── boot-every │ └── EnableSSH.sh └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | # outset-scripts 2 | Scripts I package, deploy with [Munki](https://github.com/munki/munki) and run using [Outset](https://github.com/chilcote/outset). 3 | -------------------------------------------------------------------------------- /usr/local/outset/boot-once/LocationServices.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ## Version 1.0 4 | ## Compiled by Kevin M. Cox 5 | 6 | ## This script enables macOS Location Services and is intended to run as an Outset boot-once script. 7 | ## It requires a restart to take effect. 8 | 9 | /usr/bin/defaults write /var/db/locationd/Library/Preferences/ByHost/com.apple.locationd LocationServicesEnabled -int 1 10 | -------------------------------------------------------------------------------- /usr/local/outset/login-every/DockEvery.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## Version 1.0 4 | ## Compiled by Kevin M. Cox 5 | 6 | ## Uses dockutil to add icons back to the user's dock at each login 7 | ## Should be set in Munki to REQUIRE dockutil 8 | 9 | # Add Managed Software Center to the end of the dock 10 | # Re-add it if removed from the dock but leave it alone if simply moved to a different position 11 | 12 | /usr/local/bin/dockutil --add '/Applications/Managed Software Center.app' --position end 13 | -------------------------------------------------------------------------------- /usr/local/outset/login-once/OLD/MailSettings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## Version 1.0 4 | ## Compiled by Kevin M. Cox 5 | 6 | ## Sets the initial Mail settings for users the first time they login 7 | ## These settings can then be changed by users 8 | 9 | # Show duplicate messages 10 | 11 | /usr/bin/defaults write com.apple.mail _AlwaysShowDuplicates -bool true 12 | 13 | # Only take address@example.com when copying email addresses 14 | 15 | /usr/bin/defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false 16 | -------------------------------------------------------------------------------- /usr/local/outset/login-once/DesktopPicture.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | ## Version 2.2 4 | ## by Kevin M. Cox 5 | 6 | ## Sets the initial desktop picture for all users at first login 7 | ## Should be set in Munki to REQUIRE the custom DesktopPictures.pkg, Outset and Desktoppr 8 | 9 | # Wait for the Finder to load before proceeding 10 | 11 | while ! /usr/bin/pgrep -xq Finder; do 12 | echo "Desktoppr is waiting for Finder" 13 | /bin/sleep 5 14 | done 15 | 16 | # Wait another 5 seconds just to make sure the Finder is fully loaded 17 | 18 | /bin/sleep 5 19 | 20 | # Set the user's desktop picture as The Daily News 180th Anniversary logo 21 | 22 | /usr/local/bin/desktoppr "/Library/Desktop Pictures/GalvNews 180 Years A.png" 23 | -------------------------------------------------------------------------------- /usr/local/outset/login-once/VPN-Menu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## Version 1.0 4 | ## Compiled by Kevin M. Cox 5 | 6 | ## Adds the VPN icon to the Menu Bar and sets options for users the first time they login 7 | ## These settings can then be changed by users 8 | 9 | # VPN Show Time Connected 10 | 11 | /usr/bin/defaults write com.apple.networkConnect VPNShowTime -bool true 12 | 13 | # VPN Show Status While Connecting 14 | 15 | /usr/bin/defaults write com.apple.networkConnect VPNShowStatus -bool true 16 | 17 | # Add VPN icon to Menu Bar 18 | 19 | /usr/bin/defaults write com.apple.systemuiserver menuExtras -array-add "/System/Library/CoreServices/Menu Extras/VPN.menu" 20 | 21 | # Restart the SystemUIServer so the VPN icon shows up right away 22 | 23 | killall SystemUIServer -HUP 24 | -------------------------------------------------------------------------------- /usr/local/outset/login-once/OLD/SafariSettings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## Version 1.0 4 | ## Compiled by Kevin M. Cox 5 | 6 | ## Sets the initial Safari settings for users the first time they login 7 | ## These settings can then be changed by users 8 | 9 | # Prevent Safari from opening 'safe' files automatically after downloading 10 | 11 | /usr/bin/defaults write com.apple.Safari AutoOpenSafeDownloads -bool false 12 | 13 | # Show full URL in Safari 14 | 15 | /usr/bin/defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true 16 | 17 | # Show status bar 18 | 19 | /usr/bin/defaults write com.apple.Safari ShowStatusBar -bool true 20 | /usr/bin/defaults write com.apple.Safari ShowStatusBarInFullScreen -bool true 21 | 22 | # Set Safari's home page 23 | 24 | /usr/bin/defaults write com.apple.Safari HomePage -string "https://www.galvnews.com" 25 | 26 | # Set new Safari windows to open to Safari’s default homepage: 27 | 28 | /usr/bin/defaults write com.apple.Safari NewWindowBehavior -int 0 29 | 30 | # Set new Safari tabs to open to an empty page: 31 | 32 | /usr/bin/defaults write com.apple.Safari NewTabBehavior -int 1 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Kevin M. Cox 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /usr/local/outset/login-once/OLD/MicrosoftAutoUpdate2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## Version 1.1 by Kevin M. Cox 4 | ## Original version by Erik Gomez 5 | ## https://gist.github.com/erikng/7cede5be1c0ae2f85435 6 | 7 | ## Registers the MAU application in the Launch Services database as if the user had opened it manually. 8 | ## Needs to be run by every user on the system. 9 | ## Should be set in Munki as an update_for the MAU installer. 10 | 11 | if [ -e "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app" ] 12 | then 13 | /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -R -f -trusted "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app" 14 | fi 15 | 16 | if [ -e "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/Microsoft Update Assistant.app" ] 17 | then 18 | /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -R -f -trusted "/Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app/Contents/MacOS/Microsoft Update Assistant.app" 19 | fi 20 | -------------------------------------------------------------------------------- /usr/local/outset/boot-once/DateTimeSettings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | ## Version 1.1 4 | ## by Kevin M. Cox 5 | 6 | ## Sets the time zone, closest city, NTP server and enables network time syncing 7 | 8 | # Set the Time Zone to Central 9 | 10 | /usr/sbin/systemsetup -settimezone America/Chicago 11 | 12 | # Set the Closest City to Houston, Texas 13 | 14 | /usr/bin/defaults write /Library/Preferences/.GlobalPreferences com.apple.TimeZonePref.Last_Selected_City -array "29.7608" "-95.36951" "0" "America/Chicago" "US" "Houston" "U.S.A." "Houston" "U.S.A." "DEPRECATED IN 10.6" 15 | 16 | /usr/bin/defaults write /Library/Preferences/.GlobalPreferences com.apple.preferences.timezone.new.selected_city "\032t\020\032u\024\033x\024\034r\020\035w\024\032s\024" 17 | 18 | /usr/bin/defaults write /Library/Preferences/.GlobalPreferences com.apple.preferences.timezone.selected_city -dict AppleMapID "\032t\020\032u\024\033x\024\034r\020\035w\024\032s\024" 19 | 20 | echo Closest City: Houston, Texas 21 | 22 | # Set the Time Server 23 | 24 | /usr/sbin/systemsetup -setnetworktimeserver time.apple.com 25 | 26 | # Enable NTP syncing 27 | 28 | /usr/sbin/systemsetup -setusingnetworktime on 29 | -------------------------------------------------------------------------------- /usr/local/outset/login-once/MenuBarSettings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | ## Sets initial Menu Bar options for users the first time they login 4 | 5 | ## Version 1.1 6 | ## by Kevin M. Cox 7 | 8 | 9 | # Show Battery percentage in Menu bar, works for internal batteries and UPS 10 | 11 | /usr/bin/defaults -currentHost write com.apple.controlcenter BatteryShowPercentage -bool true 12 | 13 | # Show Day Month Date Time AM/PM and flash the time separators in the Menu Clock 14 | 15 | /usr/bin/defaults write com.apple.menuextra.clock DateFormat 'EEE MMM d h:mm a' 16 | /usr/bin/defaults write com.apple.menuextra.clock FlashDateSeparators -bool true 17 | /usr/bin/defaults write com.apple.menuextra.clock ShowAMPM -bool true 18 | /usr/bin/defaults write com.apple.menuextra.clock ShowDayOfMonth -bool true 19 | /usr/bin/defaults write com.apple.menuextra.clock ShowDayOfWeek -bool true 20 | 21 | # Always show Sound in Menu Bar 22 | /usr/bin/defaults -currentHost write com.apple.controlcenter Sound -int 16 23 | 24 | # Hide WiFi in Menu Bar for desktops 25 | 26 | # Is the computer a notebook? 27 | NotebookCheck=$(sysctl -n hw.model | grep Book) 28 | 29 | if 30 | [ -z $NotebookCheck ] 31 | then # Hide WiFi in the Menu Bar for desktops 32 | /usr/bin/defaults -currentHost write com.apple.controlcenter WiFi -int 8 33 | fi 34 | -------------------------------------------------------------------------------- /usr/local/outset/boot-every/EnableSSH.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## Version 2.0 4 | ## Modified by Kevin M. Cox 5 | ## Original Script by Armin Briegel 6 | ## https://scriptingosx.com/2014/12/control-ssh-access-with-munki-nopkg-scripts/ 7 | 8 | ## This script enables SSH by loading the LaunchDaemon, a workaround that Apple may block at any time. 9 | ## It then configures SSH access for Administrators only. 10 | ## This iteration is intended to be run as an Outset boot-once or boot-every script. 11 | 12 | export PATH=/usr/bin:/bin:/usr/sbin:/sbin 13 | 14 | ssh_group="com.apple.access_ssh" 15 | 16 | # Enable SSH if needed 17 | if [[ $(systemsetup -getremotelogin) = 'Remote Login: Off' ]]; then 18 | echo "Turning on Remote Login/SSH." 19 | launchctl load -w /System/Library/LaunchDaemons/ssh.plist 20 | fi 21 | 22 | # Does a group named "com.apple.access_ssh" exist? 23 | if [[ $(dscl /Local/Default list /Groups | grep "${ssh_group}-disabled" | wc -l) -eq 1 ]]; then 24 | #rename this group 25 | echo "Renaming group '${ssh_group}-disabled'" 26 | dscl localhost change /Local/Default/Groups/${ssh_group}-disabled RecordName ${ssh_group}-disabled $ssh_group 27 | elif [[ $(dscl /Local/Default list /Groups | grep "$ssh_group" | wc -l) -eq 0 ]]; then 28 | # create group 29 | echo "Creating group $ssh_group" 30 | dseditgroup -o create -n "/Local/Default" -r "Remote Login Group" -T group $ssh_group 31 | fi 32 | 33 | # does the group contain the admin group? 34 | admin_uuid=$(dsmemberutil getuuid -G admin) 35 | if [[ $(dscl /Local/Default read Groups/$ssh_group NestedGroups | grep "$admin_uuid" | wc -l) -eq 0 ]]; then 36 | echo "Adding admin group to $ssh_group" 37 | dseditgroup -o edit -n "/Local/Default" -a admin -t group $ssh_group 38 | fi 39 | -------------------------------------------------------------------------------- /usr/local/outset/login-once/FinderSettings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | ## Version 1.1 4 | ## Compiled by Kevin M. Cox 5 | 6 | ## Sets the initial Finder settings for users at first login. 7 | ## Executed via Outset login-once. 8 | ## These settings can then be changed by users. 9 | 10 | # Show Path Bar 11 | 12 | /usr/bin/defaults write com.apple.finder ShowPathbar -bool true 13 | 14 | # Show Status Bar 15 | 16 | /usr/bin/defaults write com.apple.finder ShowStatusBar -bool true 17 | 18 | # Show Scroll Bars Always 19 | 20 | /usr/bin/defaults write -g AppleShowScrollBars -string "Always" 21 | 22 | # Set Default Finder Location to Home Folder 23 | 24 | /usr/bin/defaults write com.apple.finder NewWindowTarget -string "PfLo" 25 | /usr/bin/defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}" 26 | 27 | # Use list view in all Finder windows by default 28 | 29 | /usr/bin/defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv" 30 | 31 | # Use current directory as default search scope in Finder 32 | 33 | /usr/bin/defaults write com.apple.finder FXDefaultSearchScope -string "SCcf" 34 | 35 | # Expand save panels by default 36 | 37 | /usr/bin/defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true 38 | /usr/bin/defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true 39 | 40 | # Default to local files instead of iCloud 41 | 42 | /usr/bin/defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false 43 | 44 | # Enable snap-to-grid for icons on the desktop and in other icon views 45 | 46 | /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist 47 | 48 | # Disable Photos.app from opening when a device or card is plugged in 49 | 50 | /usr/bin/defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true 51 | 52 | # Uncheck the "Reopen windows when logging back in" logout checkbox 53 | 54 | /usr/bin/defaults write com.apple.loginwindow TALLogoutSavesState -bool false 55 | /usr/bin/defaults write com.apple.loginwindow LoginwindowLaunchesRelaunchApps -bool false 56 | -------------------------------------------------------------------------------- /usr/local/outset/login-once/DockOnce.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | ## Version 1.4 4 | ## Compiled by Kevin M. Cox 5 | 6 | ## This script uses dockutil to setup a user's dock the first time they login. 7 | ## The package deploying this script should be configured in Munki to REQUIRE both outset and dockutil. 8 | 9 | # Get the username of the logged in user 10 | LoggedInUser=$( scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' ) 11 | 12 | if 13 | # Check if the logged in user is one of our local admin accounts 14 | [ $LoggedInUser = admin1 ] || [ $LoggedInUser = admin2 ] 15 | 16 | then # Setup the dock for an admin user 17 | echo "Setting up the Dock for an administrator..." 18 | /usr/bin/defaults write com.apple.dock show-recents -bool false 19 | /usr/local/bin/dockutil --remove all --no-restart 20 | /usr/local/bin/dockutil --add '/System/Applications/Launchpad.app' --no-restart 21 | /usr/local/bin/dockutil --add '/Applications/Safari.app' --no-restart 22 | /usr/local/bin/dockutil --add '/Applications/Google Chrome.app' --no-restart 23 | /usr/local/bin/dockutil --add '/System/Applications/TextEdit.app' --no-restart 24 | /usr/local/bin/dockutil --add '/System/Applications/Utilities/Terminal.app' --no-restart 25 | /usr/local/bin/dockutil --add '/System/Applications/Utilities/Console.app' --no-restart 26 | /usr/local/bin/dockutil --add '/System/Applications/Utilities/Disk Utility.app' --no-restart 27 | /usr/local/bin/dockutil --add '/System/Applications/Utilities/Activity Monitor.app' --no-restart 28 | /usr/local/bin/dockutil --add '/Applications/DetectX Swift.app' --no-restart 29 | /usr/local/bin/dockutil --add '/Applications/MachineProfile.app' --no-restart 30 | /usr/local/bin/dockutil --add '/System/Applications/Utilities/System Information.app' --no-restart 31 | /usr/local/bin/dockutil --add '/System/Applications/System Preferences.app' --no-restart 32 | /usr/local/bin/dockutil --add '/Applications/Managed Software Center.app' --no-restart 33 | /usr/local/bin/dockutil --add '~/Downloads' 34 | 35 | else # Setup the dock for a standard user 36 | echo "Setting up the Dock for an standard user..." 37 | /usr/bin/defaults write com.apple.dock show-recents -bool false 38 | /usr/local/bin/dockutil --remove all --no-restart 39 | /usr/local/bin/dockutil --add '/Applications/Google Chrome.app' --no-restart 40 | /usr/local/bin/dockutil --add '/Applications/Slack.app' --no-restart 41 | /usr/local/bin/dockutil --add '/System/Applications/TextEdit.app' --no-restart 42 | /usr/local/bin/dockutil --add '/System/Applications/Calculator.app' --no-restart 43 | /usr/local/bin/dockutil --add '/System/Applications/Dictionary.app' --no-restart 44 | /usr/local/bin/dockutil --add '/System/Applications/Maps.app' --no-restart 45 | /usr/local/bin/dockutil --add '/System/Applications/News.app' --no-restart 46 | /usr/local/bin/dockutil --add '/System/Applications/System Preferences.app' --no-restart 47 | /usr/local/bin/dockutil --add '/Applications/Managed Software Center.app' --no-restart 48 | /usr/local/bin/dockutil --add '~/Downloads' 49 | fi 50 | --------------------------------------------------------------------------------