#!/bin/sh
# Gonéri Le Bouder <goneri@rulezlan.org>
# See http://bugs.debian.org/281164

DEFAULT="m2"
THEME=`gconftool-2 --get /apps/teg/theme`

if [ "$THEME" = "" ]; then
	NEEDTOFIX=1
fi

if [ "`ls /usr/share/games/teg/pixmaps/teg_pix/themes|grep "$THEME"`" = "" ]; then
	NEEDTOFIX=1
fi

if [ "$NEEDTOFIX" = "1" ]; then
	echo "fixing default theme"
	gconftool-2 --type string --set /apps/teg/theme $DEFAULT
fi

exec /usr/lib/games/teg/tegclient
