Index: ipk/source.sh4/titanswapskins_tobayer01/CONTROL/prerm
===================================================================
--- ipk/source.sh4/titanswapskins_tobayer01/CONTROL/prerm	(revision 23203)
+++ 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
