#!/bin/sh
set -e

# Movement of /var/lib/games to /var/games as per policy...
# (dpkg should give a warning to users the first time...)
# Movement should only be made when  updating from <-8 to =>-8
if [ -d /var/lib/games/spellcast ]; then
	if [ ! -d /var/games/spellcast ] ; then
		mkdir /var/games/spellcast
	fi
	# Are there any files here?
	if [ ! -z "`ls /var/lib/games/spellcast/*`" ] ; then
		mv /var/lib/games/spellcast/* /var/games/spellcast 
	fi
	rmdir /var/lib/games/spellcast
	chown -R games:games /var/games/spellcast
	chmod 0755 /var/games/spellcast
fi


#DEBHELPER#
