#!/bin/sh

if [ $USER == "root" ] ; then
	"Installing mp3mover system wide"
	cp -pf ./mp3mover.pl /usr/bin
	cp -pfr ./MP3 /usr/bin
else
	echo ""
	echo "You need to be root to install mp3mover system wide. You can install mp3mover locally though (it will only be available for the current user, to install system wide su to root and run this install script)"
	echo ""
	echo -n "Would you like to install mp3mover locally? [y/N] ? "
	read answer

	if [ ${#answer} -eq 0 ] ; then 
		exit
	fi
	
	if [ $answer == "y" -o $answer == "Y" ] ; then

		if [ ! -d $HOME/bin ] ; then
			mkdir $HOME/bin
		fi

		chmod 755 $HOME/bin

		cp -pf ./mp3mover.pl $HOME/bin
		cp -pfr ./MP3 $HOME/bin

		echo ""
		echo "You need to add the directory $HOME/bin to your path if it isn't already there, otherwise mp3mover.pl won't be in your path."
	fi
fi
