#!/bin/sh

PY=python

[[ -e /usr/bin/python3 ]] && PY=python3

$PY /usr/lib/enigma2/python/BoxBrandingTest.py | sed 's/<$//' | sed 's/ /_/g' > /tmp/boxbranding.cfg

if grep -qs 'getMachineBrand=xx' cat /tmp/boxbranding.cfg  ; then
	echo "                                 "
	echo "*********************************"
	echo "Not supported Box found! Aborted!"
	echo "*********************************"
	echo "                                 "
	exit 1	
else
	if [ -z "$D" -a -f "/etc/init.d/ciplushelper" ]; then
		/etc/init.d/ciplushelper stop
	fi
	if true && type update-rc.d >/dev/null 2>/dev/null; then
		if [ -n "$D" ]; then
			OPT="-f -r $D"
		else
			OPT="-f"
		fi
		update-rc.d $OPT ciplushelper remove
	fi
	if [ -z "$D" -a -f "/etc/init.d/cihelper.sh" ]; then
		/etc/init.d/cihelper.sh stop
	fi
	if true && type update-rc.d >/dev/null 2>/dev/null; then
		if [ -n "$D" ]; then
			OPT="-f -r $D"
		else
			OPT="-f"
		fi
		update-rc.d $OPT cihelper.sh remove
	fi
fi

exit 0

