v1.0 = Initial Version

+ Initial Version
This commit is contained in:
Zack T
2018-02-09 21:09:14 -07:00
parent dbb683c10d
commit cd5867bbd2

View 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