#!/bin/sh
#
TMP=/tmp/.network
echo "syncing disk"
sync

model=`cat /etc/model`
echo""
echo "Checking your Boxtype...."
echo "Some Plugins will not work correctly on your $model!"
echo ""
if [ "$model" = "ufs912" ]; then
	echo "You don`t need this package on your $model !!"
	echo "Aborting installation..."
	exit 1
elif [ "$model" = "" ]; then
	echo "Sorry! This Plugin is not available for your $model because it will not work correctly!!!"
	echo "Aborting installation..."
	exit 1
else
	echo "Boxtype: $model OK"
fi

echo "checking swapstick"
if [ ! -d /var/swap/lib/ ]; then
  echo "--------------------------"
	echo "no swapstick found...."
	echo "--------------------------"
	exit 1
fi
echo "swapstick found...."
echo "installing Networkfile libsmbclient 3.0.28 to swapstick..."
echo "deleting libsmbclient.so.0 LINK in /var/usr/lib"
rm /var/usr/lib/libsmbclient.so.0

buildgroup=`cat /etc/.buildgroup`
echo "checking OS"	 
if  [ `cat /etc/motd | grep $buildgroup | grep M | grep rev | wc -l` -eq 0 ]; then 	 	 
	echo --------------------------- 	 	 
	echo DONT USE this IPK Package!! 	 	 
	echo --- 	 	 
	echo Only for $buildgroup Image!! 	 	 
	echo --------------------------- 	 	 
	exit 1 	 	 
fi

exit 0