#!/bin/sh
myuser=$(whoami)

if [ ${myuser} = "root" ]; then
    echo "don't run this as root!"
    exit 1
else
    cd /home/${myuser}/Desktop

	echo "start downloading file..."
	wget www.scilab.org/download/5.3.3/scilab-5.3.3.bin.linux-i686.tar.gz
	mv scilab-5.3.3.bin.linux-i686.tar.gz /home/${myuser}
	cd ..

	echo "extract packet..."
	tar -xvf scilab-5.3.3.bin.linux-i686.tar.gz 
	cd Desktop

	echo "making startup script..."
	touch scilab.sh
	echo "#!/bin/sh" >> scilab.sh
	echo "cd /home/${myuser}/scilab-5.3.3/bin" >> scilab.sh
	echo "./scilab" >> scilab.sh
	chmod 755 scilab.sh
	cd ..
	rm scilab-5.3.3.bin.linux-i686.tar.gz

	echo "done, click scilab.sh and run :)"
	
	exit 0
fi



