Created
June 13, 2019 22:24
-
-
Save soundsnw/00e4c23d4dd2140e2fa53f4fd3a58120 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
loggedInUser=$( /usr/sbin/scutil <<< "show State:/Users/ConsoleUser" | awk -F’: ‘ ‘/[[:space:]]+Name[[:space:]]:/ { if ( $2 != "loginwindow" ) { print $2 }}’ ) | |
sudo -u $loggedInUser chflags -R nouchg /Users/$loggedInUser | |
diskutil resetUserPermissions / $loggedInUser | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment