From 4263b6f167827987cb3cb7e970b351ef69561cfa Mon Sep 17 00:00:00 2001 From: mollusk Date: Tue, 26 Jul 2016 08:08:09 -0700 Subject: [PATCH] [Updated] euphoria-install.sh: Cleaned up code formatting --- euphoria-install.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/euphoria-install.sh b/euphoria-install.sh index 268c913..93b86f6 100755 --- a/euphoria-install.sh +++ b/euphoria-install.sh @@ -26,6 +26,7 @@ check_deps(){ } check_root(){ + if [[ $EUID -ne 0 ]]; then printf "${LRED}This script must be run as root${NC}\n" 1>&2 exit 1 @@ -33,6 +34,7 @@ check_root(){ } check_install(){ + if [ ! -d ${target_dir}/${name}-${version}-Linux-${arch} ];then printf "Install check passed...moving on...\n" else @@ -40,6 +42,7 @@ check_install(){ exit 0; fi } + download_pkgs(){ if [ ! -f ${tmpdir}/${name}-${version}.${fext} ];then @@ -87,6 +90,7 @@ uninstall_pkg(){ if [ ! -d ${target_dir}/${name}-${version}-Linux-${arch} ];then printf "${name}-${version} is not installed\n" else + rm -v -r ${target_dir}/${name}-${version}-Linux-${arch} rm -v /usr/bin/eui rm -v /usr/bin/euc @@ -101,6 +105,7 @@ uninstall_pkg(){ rm -v /usr/bin/echoversion rm -v /usr/bin/creole rm -v /usr/bin/eucoverage + if [ ! -d ${target_dir}/${name}-${version}-Linux-${arch} ];then echo printf "${name}-${version} is uninstalled\n" @@ -133,6 +138,8 @@ remove_tmp(){ exit 0; fi } + + case $1 in install | i) check_root @@ -143,13 +150,16 @@ case $1 in install_build post_install ;; + remove | r) check_root uninstall_pkg ;; -clean | c) - remove_tmp + + clean | c) + remove_tmp ;; + *) printf """ [SYNOPSIS]