Network Share

New Contributor II

We changed the network share to a different name and the Mac and still trying to connect to the old share path. Can't figure out why. We are also leveraging Enterprise Connect in our environment as well. I have already checked Login Items in System Preferences and nothing is listed there. Below is the script


userName=$(stat -f %Su /dev/console)

This should never be run at the login window, but checking just in case.

if [[ "$userName" != "root" ]] && [[ "$userName" != "" ]]; then shareURL="smb://corpfs01/Public"

existingURL="$(sudo -u $userName -H defaults read shares | grep "$shareURL")"

if [[ "$existingURL" == "" ]] ; then # Quit Enterprise Connect sudo -u $userName -H killall "Enterprise Connect" sleep 2

# Add network drive mapping sudo -u $userName -H defaults write shares -array-add "{ "path" = "$shareURL"; }"

# Restart Enterprise Connect sudo -u $userName -H open "/Applications/Enterprise" fi

exit 0