#!/bin/sh
#
TMP=/tmp/.picon
echo "syncing disk"
sync

model=`cat /etc/model`
echo""
echo "Checking your Boxtype...."
echo "Some Plugins will not work correctly on your $model!"
echo ""
if [ "$model" = "" ]; then
	echo "Sorry! This Plugin is not available for your $model because it will not work correctly!!!"
	echo "Aborting installation..."
	exit 1
else
	echo "Boxtype: $model OK"
fi

if [ -e /etc/.fullusb ] || [ -e /etc/.usbimage ]; then
	echo "detected USB Image...."
	echo "ok..."
elif [ "$model" = "ufs912" ]; then
	echo "detected Boxtype : $model...."
	echo "ok..."
else
	if [ `ls -la /var/usr/local/share/enigma2 | grep "/var/swap/picon" | wc -l` -ge 1 ]; then
		echo "check ok...installing to swapstick...."
	else
		echo "ERROR: this package will not fit in your flash..."
		echo "...you need a swapstick to install the package on your $model...!"
		echo "aborting installation..."
		exit 1
	fi
fi

echo "installing hd picons for Astra 19.2..."
echo "checking OS"
if [ `cat /etc/motd | grep AAF | grep M | grep rev | wc -l` -eq 0 ]; then
	echo ---------------------------
	echo DONT USE this IPK Package!!
	echo ---
	echo Only for AAF Image!!
	echo ---------------------------
	exit 1
fi
exit 0
