mirror of
https://github.com/MLBZ521/MacAdmin.git
synced 2026-03-20 16:00:25 +00:00
v1.0 = Initial Version
+ Initial Version
This commit is contained in:
23
System Configs/fix_UserHomeDirectory.sh
Normal file
23
System Configs/fix_UserHomeDirectory.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
###################################################################################################
|
||||
# Script Name: fix_UserHomeDirectory.sh
|
||||
# By: Zack Thompson / Created: 1/11/2018
|
||||
# Version: 1.0 / Updated: 1/11/2018 / By: ZT
|
||||
#
|
||||
# Description: This script fixes an incorrectly configured user account Home Directory
|
||||
#
|
||||
###################################################################################################
|
||||
|
||||
username="$4"
|
||||
|
||||
homeDir=$(/usr/bin/dscl . read /Users/$username/ NFSHomeDirectory | /usr/bin/awk -F ": " '{print $2}')
|
||||
|
||||
if [[ $homeDir == "//"* ]]; then
|
||||
/bin/echo "Incorrect home directory... Fixing..."
|
||||
/usr/bin/dscl . -change $homeDir NFSHomeDirectory $homeDir /Users/$username
|
||||
fi
|
||||
|
||||
/bin/echo "Correct home directory set!"
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user