Index: ipk/source.sh4/titanswapskins_tobayer01/CONTROL/postinst
===================================================================
--- ipk/source.sh4/titanswapskins_tobayer01/CONTROL/postinst	(revision 23203)
+++ ipk/source.sh4/titanswapskins_tobayer01/CONTROL/postinst	(revision 23247)
@@ -2,25 +2,46 @@
 
 releaseversion=22775
-plugin="tobayer01 swapskin"
-plugindir="/var/swap/titanskins/tobayer01"
+plugin_short="tobayer01"
+plugin_type="swapskin"
+plugin_target="/var/swap/titanskins"
+
+plugin_dir="$plugin_target/$plugin_short"
+plugin="$plugin_short $plugin_type"
+
 imageversion=`cat /etc/version | cut -d "_" -f2 | sed 's/M//'`;
-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`
-	FREE=`expr $SPACE - 100`
-	echo "New free space: $FREE kb"
-else
-	sync
-fi
+
+### FUNCTIONS ###
+
+RES_COL=60									# column number to place the status message
+MOVE_TO_COL="echo -en \\033[${RES_COL}G"	# command to move to the configured column number
+
+echo_success() {							# function to print the SUCCESS status
+	$MOVE_TO_COL; echo -n "[  OK  ]"; echo
+}
+
+echo_failure() {
+	$MOVE_TO_COL; echo -n "[FAILED]"; echo	# function to print the FAILED status message
+}
+
+
+
+### 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 $plugindir/skin_release.xml
+	rm $plugin_dir/skin_release.xml
 else
 	echo "Successfully installed $plugin (release version)."
 	# ==> mv skin_release.xml skin.xml"
-	mv $plugindir/skin_release.xml $plugindir/skin.xml
+	mv $plugin_dir/skin_release.xml $plugin_dir/skin.xml
 fi
 
