Index: ipk/source.sh4/swapemus_oscam_6089/CONTROL/preinst
===================================================================
--- ipk/source.sh4/swapemus_oscam_6089/CONTROL/preinst	(revision 23015)
+++ ipk/source.sh4/swapemus_oscam_6089/CONTROL/preinst	(revision 23298)
@@ -2,4 +2,5 @@
 #
 TMP=/tmp/.oscam
+INSTDIR="$1"
 
 model=`cat /etc/model`
@@ -16,16 +17,18 @@
 fi
 
-echo "checking swapstick"
-if [ ! -d /var/swap/bin/ ]; then
+echo "checking install path"
+if [ ! -d "$INSTDIR/bin/" ]; then
   echo "--------------------------"
-	echo "no swapstick found...."
+	echo "no install path found...."
 	echo "--------------------------"
 	exit 1
 fi
-echo "swapstick found...."
+echo "install path found...."
 
-link=`readlink /var/swap`
-if [ `df | grep /dev/mtdblock | grep mnt | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1 | wc -l` -eq 1 ] && [ $link = "/mnt/swapextensions" ]; then
-	SPACE=`df | grep /dev/mtdblock | grep mnt | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1`
+if [ "/var/swap" == "$INSTDIR" ]; then
+	echo "syncing disk"
+	sync
+else	
+	SPACE=`getfreespace "$INSTDIR"`
 	FREE=`expr $SPACE - 100`
 	SIZE=936
@@ -39,7 +42,4 @@
 		echo ok		
 	fi
-else
-	echo "syncing disk"
-	sync
 fi
 
@@ -48,5 +48,5 @@
 if  [ `cat /etc/motd | grep $buildgroup | grep M | grep rev | wc -l` -eq 0 ]; then 	 	 
 	echo --------------------------- 	 	 
-	echo DONT USE this IPK Package!! 	 	 
+	echo DONT USE this TPK Package!! 	 	 
 	echo --- 	 	 
 	echo Only for $buildgroup Image!! 	 	 
@@ -54,5 +54,5 @@
 	exit 1 	 	 
 fi
-echo "installing Oscam Build 6089 to swapstick..."
+echo "installing Oscam Build 6089..."
 
 exit 0
