diff --git a/euphoria-install.sh b/euphoria-install.sh index b1123c3..c5c3b87 100755 --- a/euphoria-install.sh +++ b/euphoria-install.sh @@ -7,10 +7,24 @@ state="beta2" arch="x64" fext="tar.gz" extcmd="tar" +deps="curl" target_dir="/usr/local" url="http://nbtelecom.dl.sourceforge.net/project/rapideuphoria/Euphoria/${version}-${state}/${name}-${version}-Linux-${arch}-57179171dbed.${fext}" tmpdir="/tmp" +check_deps(){ + + get_path=$(which curl) + + if [ ! ${get_path} ];then + printf "Please install: ${deps}" + exit 0; + else + printf "Deps passed checks..moving on\n" + fi + +} + check_root(){ if [[ $EUID -ne 0 ]]; then printf "${LRED}This script must be run as root${NC}\n" 1>&2 @@ -96,14 +110,39 @@ uninstall_pkg(){ fi fi } + +remove_tmp(){ + echo + printf "Do you want to remove ${tmpdir}/${name}-${version}-Linux-${arch} and ${tmpdir}/${name}-${version}.${fext}: " + printf "[y/n]\n" + read choice + + if [ "${choice}" = "y" ];then + rm -v -r ${tmpdir}/${name}-${version}-Linux-${arch} + rm -v -r ${tmpdir}/${name}-${version}.${fext} + if [ ! -d ${tmpdir}/${name}-${version}-Linux-${arch} ] && [ ! -f ${tmpdir}/${name}-${version}.${fext} ];then + printf "${tmpdir} cleared\n" + else + printf "Failed to remove files\n" + fi + elif [ "${choice}" = "n" ];then + printf "Exiting...\n" + exit 0; + else + printf "Skipping and exiting...\n" + exit 0; + fi +} case $1 in install) check_root + check_deps check_install download_pkgs extract_files install_build post_install + remove_tmp ;; uninstall) check_root