#! /bin/sh
# installLibftdi : 
#	Installing script for newer libftdi on linux
# 	Run this program from some temporal directory
#   This program invokes installOpenOCD script

echo "!!! Caution !!! "
echo "Please read README file before this command. "
echo -n "Do you want to continue to install? [Y/N]: "
read line
case $line in
	[yY])
		sudo apt-get remove libftdi1
		rm libftdi-0.17.tar.gz -f
		wget http://www.intra2net.com/en/developer/libftdi/download/libftdi-0.17.tar.gz
		tar xvzf libftdi-0.17.tar.gz
		rm libftdi-0.17.tar.gz -f
		cd libftdi-0.17
		./configure
		make
		sudo make install
		cd ..
		rm libftdi-0.17 -r
		./installOpenOCD
		break
		;;
	[nN])
		echo "Canceled."
		break;
		;;
esac
