Hi All,
I'm trying to run the following script on El Cap to do user folder redirection:
#!/bin/sh
# Determine USERNAME variable
username=$(ls -l /dev/console | awk '{print $3}')
# Determine NETHOME variable
netvol=$(dscl '/Active Directory/DOMAIN/All Domains' -read /Users/$username SMBHome | cut -d'' -f4)
netfolder=$(dscl '/Active Directory/DOMAIN/All Domains' -read /Users/$username SMBHome | cut -d'' -f5)
nethome=$(echo "/Volumes/"$netvol"/"$netfolder)
# Redirect the Documents folder
if [ ! -d $nethome/Documents ]
then
mkdir $nethome/Documents
fi
rm -Rf /Users/$username/Documents
ln -s $nethome/Documents $HOME/Documents
# Redirect the Desktop folder
if [ ! -d $nethome/Desktop ]
then
mkdir $nethome/Desktop
fi
rm -Rf /Users/$username/Desktop
ln -s $nethome/Desktop $HOME/Desktop
# Redirect the Downloads folder
if [ ! -d $nethome/Downloads ]
then
mkdir $nethome/Downloads
fi
rm -Rf /Users/$username/Downloads
ln -s $nethome/Downloads $HOME/Downloads
exit 0
The issue I have is with the rm command lines, I get permission denied. Has anyone else seen this with deleting User folders? and if so, is it a SIP issue, and is there a way around it?
I have a lot of Multiuser lab machines for students, and I'm trying to stay away from Portable Home Directories.
Thanks,
Tim
