#!/bin/sh
TMP=/tmp/.infos

if [ -e /tmp/instar.conf ]; then
	mv /var/usr/local/share/titan/plugins/instar/instar.conf /var/usr/local/share/titan/plugins/instar/instar.conf_org
	cp  /tmp/instar.conf /var/usr/local/share/titan/plugins/instar/instar.conf
	rm /tmp/instar.conf
fi

echo "successfully installed"
if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1 | wc -l` -eq 1 ]; then
	SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1`
	FREE=`expr $SPACE - 100`
	echo new freespace size $FREE kb
else
	echo "syncing disk"
	sync
fi
exit 0