#!/bin/sh
#	DESCRIZIONE = Questo script attiva/disattiva la spinner (on/off).

if [ -e /usr/share/enigma2/skin_default/spinner/wait1.png ]; then
	echo "Spinner obviously activated.\n\n Deactivating...\n"
	find "/usr/share/enigma2/skin_default/spinner" -name "wait*.png" -print | while read i; do
		mv "$i" "$i.backup"
	done
	echo "Spinner deactivated!\n (you need to restart Enigma2 to finish the job)\n"
	exit 0
else
	echo "No spinner active.\n\n Activating...\n"
	if [ -e /usr/share/enigma2/skin_default/spinner/wait1.png.backup ]; then
		find "/usr/share/enigma2/skin_default/spinner" -name "wait*.png.backup" -print | while read i; do
			mv "$i" ${i%*.backup*}
		done
		echo "Spinner is now active again!\n (you need to restart Enigma2 to finish the job)\n"
		exit 0
	else
		echo "Could not find any spinner for activating!\n"
		exit 1
	fi
fi
