#!/bin/sh
TMP=/tmp/.swapscreensaver
echo "successfully installed"

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 freespace size $FREE kb
else
	echo "syncing disk"
	sync
fi
echo "please reboot your box so that the extension will be mounted..."
exit 0