Index: ipk/source.sh4/titanskins_tobayer01/CONTROL/postinst
===================================================================
--- ipk/source.sh4/titanskins_tobayer01/CONTROL/postinst	(revision 23139)
+++ ipk/source.sh4/titanskins_tobayer01/CONTROL/postinst	(revision 23270)
@@ -1,14 +1,32 @@
 #!/bin/sh
-TMP=/tmp/.titanskin
-echo "successfully installed"
 
-echo "now you can choose the new skin...."
-if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1 | wc -l` -eq 1 ]; then
-	SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1`
-	FREE=`expr $SPACE - 100`
-	echo new freespace size $FREE kb
+releaseversion=22775
+plugin_short="tobayer01"
+plugin_type="skin"
+plugin_target="/var/usr/local/share/titan/skin"
+
+plugin_dir="$plugin_target/$plugin_short"
+plugin="$plugin_short $plugin_type"
+
+imageversion=`cat /etc/version | cut -d "_" -f2 | sed 's/M//'`;
+
+
+### MAIN ###
+
+sync
+SPACE=`getfreespace $plugin_target`
+FREE=`expr $SPACE - 100`
+echo
+echo "New free space: ${FREE}kB"
+
+
+if [ "$imageversion" -gt "$releaseversion" ]; then
+	echo "Successfully installed $plugin (non-release version)."
+	# ==> rm skin_release.xml
+	rm $plugin_dir/skin_release.xml
 else
-	echo "syncing disk"
-	sync
+	echo "Successfully installed $plugin (release version)."
+	# ==> mv skin_release.xml skin.xml"
+	mv $plugin_dir/skin_release.xml $plugin_dir/skin.xml
 fi
 
Index: ipk/source.sh4/titanskins_tobayer01/CONTROL/postrm
===================================================================
--- ipk/source.sh4/titanskins_tobayer01/CONTROL/postrm	(revision 23139)
+++ ipk/source.sh4/titanskins_tobayer01/CONTROL/postrm	(revision 23270)
@@ -1,16 +1,22 @@
 #!/bin/sh
-TMP=/tmp/.skin
 
-PLUGINDIR=/var/usr/local/share/titan/skin/tobayer01
-rm -r /var/usr/local/share/titan/skin/tobayer01
+plugin_short="tobayer01"
+plugin_type="skin"
+plugin_target="/var/usr/local/share/titan/skin"
 
-echo "successfully removed"
-if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1 | wc -l` -eq 1 ]; then
-	SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1`
-	FREE=`expr $SPACE - 100`
-	echo new freespace size $FREE kb
-else
-	echo "syncing disk"
-	sync
-fi
+plugin_dir="$plugin_target/$plugin_short"
+plugin="$plugin_short $plugin_type"
+
+
+### MAIN ###
+
+rm -rf $plugin_dir
+
+sync
+SPACE=`getfreespace $plugin_target`
+FREE=`expr $SPACE - 100`
+echo "New free space: ${FREE}kB"
+echo
+echo "Successfully removed $plugin."
+
 exit 0
Index: ipk/source.sh4/titanskins_tobayer01/CONTROL/preinst
===================================================================
--- ipk/source.sh4/titanskins_tobayer01/CONTROL/preinst	(revision 23139)
+++ ipk/source.sh4/titanskins_tobayer01/CONTROL/preinst	(revision 23270)
@@ -1,51 +1,76 @@
 #!/bin/sh
-#
-TMP=/tmp/.titanskin
-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!!!"
+plugin_size=2300
+plugin_short="tobayer01"
+plugin_type="skin"
+plugin_target="/var/usr/local/share/titan/skin"
+
+plugin_dir="$plugin_target/$plugin_short"
+plugin="$plugin_short $plugin_type"
+
+
+### MAIN ###
+
+# Is this check for anything useful???
+#model=`cat /etc/model`
+#echo -n "Checking box type..."
+#if [ "$model" = "" ]; then
+#	echo "......[FAILED]"
+#	echo
+#	echo "Sorry, $plugin is not available for the $model!"
+#	echo "Aborting installation..."
+#	exit 1
+#else
+#	echo "......[OK]"
+#fi
+
+
+echo -n "Checking installation directory..."
+if [ ! -d $plugin_target ]; then
+	echo "......[FAILED]"
+	echo
+	echo "'$plugin_target' not found!"
 	echo "Aborting installation..."
 	exit 1
 else
-	echo "Boxtype: $model OK"
+#	echo "......[OK]"
+	echo
 fi
 
-if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1 | wc -l` -eq 1 ]; then
-	SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1`
-	FREE=`expr $SPACE - 100`
-	SIZE=1050
-	echo "checking freespace"
-	echo package size $SIZE kb
-	echo freespace size $FREE kb
-	if  [ "$FREE" -lt "$SIZE" ]; then
-		echo "sorry no freespace left on device"
-		exit 1
-	else
-		echo ok		
-	fi
+
+sync
+SPACE=`getfreespace $plugin_target`
+FREE=`expr $SPACE - 100`
+echo -n "Checking free space (${plugin_size}/${FREE}kB)..."
+if [ "$FREE" -lt "$plugin_size" ]; then
+	echo "......[FAILED]"
+	echo
+	echo "Not enough free space in $plugin_target!"
+	echo "Aborting installation..."
+	exit 1
 else
-	echo "syncing disk"
-	sync
+#	echo "......[OK]"
+	echo
 fi
 
-buildgroup=`cat /etc/.buildgroup`
-echo "checking OS"	 
-if  [ `cat /etc/motd | grep $buildgroup | grep M | grep rev | wc -l` -eq 0 ]; then 	 	 
-	echo --------------------------- 	 	 
-	echo DONT USE this IPK Package!! 	 	 
-	echo --- 	 	 
-	echo Only for $buildgroup Image!! 	 	 
-	echo --------------------------- 	 	 
-	exit 1 	 	 
-fi
-  
-echo "installing tobayer01 skin ..."
+
+# Is this check for anything useful???
+#buildgroup=`cat /etc/.buildgroup`
+#echo -n "Checking image type..."
+#if [ `cat /etc/version | grep $buildgroup | wc -l` -eq 0 ]; then
+#	echo "......[FAILED]"
+#	echo
+#	echo "Sorry, $plugin is not available for this image type!"
+#	echo "Aborting installation..."
+#	exit 1
+#else
+#	echo "......[OK]"
+#fi
+
+
+rm -rf $plugin_dir
+
+#echo -n "Installing $plugin..."
+#echo "......[OK]"
 
 exit 0
Index: ipk/source.sh4/titanskins_tobayer01/CONTROL/prerm
===================================================================
--- ipk/source.sh4/titanskins_tobayer01/CONTROL/prerm	(revision 23139)
+++ ipk/source.sh4/titanskins_tobayer01/CONTROL/prerm	(revision 23270)
@@ -1,12 +1,18 @@
 #!/bin/sh
-TMP=/tmp/.titanskin
-if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1 | wc -l` -eq 1 ]; then
-	SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1`
-	FREE=`expr $SPACE - 100`
-	echo new freespace size $FREE kb
-else
-	echo "syncing disk"
-	sync
-fi
-echo "removing tobayer01 skin"
+
+plugin_short="tobayer01"
+plugin_type="skin"
+plugin_target="/var/usr/local/share/titan/skin"
+
+plugin_dir="$plugin_target/$plugin_short"
+plugin="$plugin_short $plugin_type"
+
+
+### MAIN ###
+
+sync
+SPACE=`getfreespace $plugin_target`
+FREE=`expr $SPACE - 100`
+echo "Old free space: ${FREE}kB"
+
 exit 0
