Index: /ipk/source.sh4/titanswapskins_tobayer01/CONTROL/postinst
===================================================================
--- /ipk/source.sh4/titanswapskins_tobayer01/CONTROL/postinst	(revision 23246)
+++ /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
 
Index: /ipk/source.sh4/titanswapskins_tobayer01/CONTROL/postrm
===================================================================
--- /ipk/source.sh4/titanswapskins_tobayer01/CONTROL/postrm	(revision 23246)
+++ /ipk/source.sh4/titanswapskins_tobayer01/CONTROL/postrm	(revision 23247)
@@ -1,17 +1,36 @@
 #!/bin/sh
 
-plugin="tobayer01 swapskin"
-plugindir="/var/swap/titanskins/tobayer01"
-link=`readlink /var/swap`
+plugin_short="tobayer01"
+plugin_type="swapskin"
+plugin_target="/var/swap/titanskins"
 
-rm -rf $plugindir
+plugin_dir="$plugin_target/$plugin_short"
+plugin="$plugin_short $plugin_type"
 
-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 ###
+
+rm -rf $plugin_dir
+
+sync
+SPACE=`getfreespace $plugin_target`
+FREE=`expr $SPACE - 100`
+echo
+echo "New free space: $FREE kB"
 
 echo "Successfully removed $plugin."
Index: /ipk/source.sh4/titanswapskins_tobayer01/CONTROL/preinst
===================================================================
--- /ipk/source.sh4/titanswapskins_tobayer01/CONTROL/preinst	(revision 23246)
+++ /ipk/source.sh4/titanswapskins_tobayer01/CONTROL/preinst	(revision 23247)
@@ -1,67 +1,88 @@
 #!/bin/sh
 
-plugin="tobayer01 swapskin"
-plugindir="/var/swap/titanskins/tobayer01"
-pluginsize=2300
+plugin_size=2300
+plugin_short="tobayer01"
+plugin_type="swapskin"
+plugin_target="/var/swap/titanskins"
+
+plugin_dir="$plugin_target/$plugin_short"
+plugin="$plugin_short $plugin_type"
+
 model=`cat /etc/model`
-link=`readlink /var/swap`
 buildgroup=`cat /etc/.buildgroup`
 
-sync
 
-echo "Checking your box type..."
+### 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 ###
+
+echo -n "Checking box type..."
 if [ "$model" = "" ]; then
-	echo ""
-	echo "Sorry! This plugin is not available for your $model, because it will not work correctly!"
+	echo_failure
+	echo
+	echo "Sorry, $plugin is not available for the $model!"
 	echo "Aborting installation..."
 	exit 1
 else
-	echo "Box type $model is OK."
+	echo_success
 fi
 
-echo ""
-echo "Checking swapstick..."
-if [ ! -d /var/swap/titanskins/ ]; then
-	echo "----------------------"
-	echo "Swapstick not found..."
-	echo "----------------------"
+
+echo -n "Checking installation directory..."
+if [ ! -d $plugin_target ]; then
+	echo_failure
+	echo
+	echo "Sorry, $plugin_target not found!"
+	echo "Aborting installation..."
 	exit 1
 else
-	echo "Swapstick is OK."
+	echo_success
 fi
 
-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 ""
-	echo "Checking free space..."
-	echo "Package size $pluginsize kb"
-	echo "Free space $FREE kb"
-	if [ "$FREE" -lt "$pluginsize" ]; then
-		echo "Sorry, not enough free space on your device!"
-		exit 1
-	else
-		echo "OK"
-	fi
+
+sync
+SPACE=`getfreespace $plugin_target`
+FREE=`expr $SPACE - 100`
+echo -n "Checking free space ($plugin_size in $FREE kB)..."
+if [ "$FREE" -lt "$plugin_size" ]; then
+	echo_failure
+	echo
+	echo "Sorry, not enough free space in $plugin_target!"
+	echo "Aborting installation..."
+	exit 1
 else
-	sync
+	echo_success
 fi
 
-echo ""
-echo "Checking OS..."
-if [ `cat /etc/motd | grep $buildgroup | grep M | grep rev | wc -l` -eq 0 ]; then 	 	 
-	echo "---------------------------"
-	echo "Don't use this TPK package!"
-	echo "---"
-	echo "Only for $buildgroup image!"
-	echo "---------------------------"
+
+echo -n "Checking image type..."
+if [ `cat /etc/version | grep $buildgroup | wc -l` -eq 0 ]; then
+	echo_failure
+	echo
+	echo "Sorry, $plugin is not available for this image type!"
+	echo "Aborting installation..."
 	exit 1
 else
-	echo "OS is OK."
+	echo_success
 fi
 
-rm -rf $plugindir
-echo ""
-echo "Installing $plugin..."
+
+rm -rf $plugin_dir
+
+echo -n "Installing $plugin..."
+echo_success
 
 exit 0
Index: /ipk/source.sh4/titanswapskins_tobayer01/CONTROL/prerm
===================================================================
--- /ipk/source.sh4/titanswapskins_tobayer01/CONTROL/prerm	(revision 23246)
+++ /ipk/source.sh4/titanswapskins_tobayer01/CONTROL/prerm	(revision 23247)
@@ -1,16 +1,37 @@
 #!/bin/sh
 
-plugin="tobayer01 swapskin"
-link=`readlink /var/swap`
+plugin_short="tobayer01"
+plugin_type="swapskin"
+plugin_target="/var/swap/titanskins"
 
-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 "Old free space: $FREE kb"
-else
-	sync
-fi
+plugin_dir="$plugin_target/$plugin_short"
+plugin="$plugin_short $plugin_type"
 
-echo "Removing $plugin..."
+
+### 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 "Old free space: $FREE kB"
+
+
+echo -n "Removing $plugin..."
+echo_success
 
 exit 0
