Skype Network Home Workaround

I recently started deployment of Skype in a OS X network home environment. During the deployment, I found login times were excessive on all machine without a mobile home directory, or that login would generally fail.

After troubleshooting a bit, I found the issue to be a problem with one of the files located in ˜/Library/Application Support/Skype directory. By relocating this directory to the local drive the issue was resolved.

In order to resolve this problem on a larger scale, I created two scripts. I used Apple Remote Desktop to copy the files to /usr/local/libexec and called unix commands on each of the machines. The first script is run as root and sets up the directories for all users that may potentially log onto that machine. It expects a list of short usernames. You may need to change the group variable to fit your needs.

	GROUPNAME=staff
	ME=`whoami`
	if [ "${ME}" != "root" ]; then
		echo "This script must be run as root."
		exit
	fi
	
	if [ $# -eq 0 ]; then
		echo "No users provided"
		exit
	fi
	
	cd /Users/Shared
	
	if [ -e Skype ]; then
		echo "/Users/Shared/Skype already exits."
		exit
	fi
	
	mkdir Skype
	chown root:wheel Skype
	chmod 777 Skype
	
	cd ./Skype
	
	for var in "$@"
	do
		echo "${var}"
		mkdir "${var}"
		mkdir "./${var}/Skype"
		chown -R "${var}":"${GROUPNAME}" "${var}"
	done

The second script is run as each logged in user, to setup a symlink to the appropriate directory on the local drive. It also moves any current Skype preferences out of the way to avoid problems. Skype cannot be running when this script is run, so it checks for the Skype process and exits without modification if Skype is running.

	pid=`ps ax | grep Skype | grep -v grep | awk '{print $1;}'`
	if [ "X${pid}" != "X" ]; then
		echo "Skype is currently running."
		exit
	fi
	
	# Setup symlink
	
	ME=`whoami`
	
	cd ~/Library/"Application Support"
	
	if [ -e Skype ]; then
		mv Skype Skype.old
	fi
	ln -s /Users/Shared/Skype/"${ME}"/Skype Skype
	
	# Move out preferences
	
	cd ~/Library/Preferences
	
	if [ -e com.skype.skype.plist ]; then
		mv com.skype.skype.plist com.skype.skype.plist.old
	fi

Even if you apply the scripts to the user's system, if the user has already tried logging in, you may need to increment the incoming connection port in Skype's advanced preferences.

The network home issue has been reported to Skype support so they are currently aware of it. Hopefully in one of the next few updates they will resolve this issue and the above scripts will no longer be required. In the meantime, you can download this work around below. There are two files: skype-dir.sh and skype-ln.sh.

Skype Workaround Scripts