[Updated] euphoria-install.sh: Cleaned up code formatting
This commit is contained in:
parent
7ff150fe89
commit
4263b6f167
@ -26,6 +26,7 @@ check_deps(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
check_root(){
|
check_root(){
|
||||||
|
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
printf "${LRED}This script must be run as root${NC}\n" 1>&2
|
printf "${LRED}This script must be run as root${NC}\n" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
@ -33,6 +34,7 @@ check_root(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
check_install(){
|
check_install(){
|
||||||
|
|
||||||
if [ ! -d ${target_dir}/${name}-${version}-Linux-${arch} ];then
|
if [ ! -d ${target_dir}/${name}-${version}-Linux-${arch} ];then
|
||||||
printf "Install check passed...moving on...\n"
|
printf "Install check passed...moving on...\n"
|
||||||
else
|
else
|
||||||
@ -40,6 +42,7 @@ check_install(){
|
|||||||
exit 0;
|
exit 0;
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
download_pkgs(){
|
download_pkgs(){
|
||||||
|
|
||||||
if [ ! -f ${tmpdir}/${name}-${version}.${fext} ];then
|
if [ ! -f ${tmpdir}/${name}-${version}.${fext} ];then
|
||||||
@ -87,6 +90,7 @@ uninstall_pkg(){
|
|||||||
if [ ! -d ${target_dir}/${name}-${version}-Linux-${arch} ];then
|
if [ ! -d ${target_dir}/${name}-${version}-Linux-${arch} ];then
|
||||||
printf "${name}-${version} is not installed\n"
|
printf "${name}-${version} is not installed\n"
|
||||||
else
|
else
|
||||||
|
|
||||||
rm -v -r ${target_dir}/${name}-${version}-Linux-${arch}
|
rm -v -r ${target_dir}/${name}-${version}-Linux-${arch}
|
||||||
rm -v /usr/bin/eui
|
rm -v /usr/bin/eui
|
||||||
rm -v /usr/bin/euc
|
rm -v /usr/bin/euc
|
||||||
@ -101,6 +105,7 @@ uninstall_pkg(){
|
|||||||
rm -v /usr/bin/echoversion
|
rm -v /usr/bin/echoversion
|
||||||
rm -v /usr/bin/creole
|
rm -v /usr/bin/creole
|
||||||
rm -v /usr/bin/eucoverage
|
rm -v /usr/bin/eucoverage
|
||||||
|
|
||||||
if [ ! -d ${target_dir}/${name}-${version}-Linux-${arch} ];then
|
if [ ! -d ${target_dir}/${name}-${version}-Linux-${arch} ];then
|
||||||
echo
|
echo
|
||||||
printf "${name}-${version} is uninstalled\n"
|
printf "${name}-${version} is uninstalled\n"
|
||||||
@ -133,6 +138,8 @@ remove_tmp(){
|
|||||||
exit 0;
|
exit 0;
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
install | i)
|
install | i)
|
||||||
check_root
|
check_root
|
||||||
@ -143,13 +150,16 @@ case $1 in
|
|||||||
install_build
|
install_build
|
||||||
post_install
|
post_install
|
||||||
;;
|
;;
|
||||||
|
|
||||||
remove | r)
|
remove | r)
|
||||||
check_root
|
check_root
|
||||||
uninstall_pkg
|
uninstall_pkg
|
||||||
;;
|
;;
|
||||||
clean | c)
|
|
||||||
remove_tmp
|
clean | c)
|
||||||
|
remove_tmp
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
printf """
|
printf """
|
||||||
[SYNOPSIS]
|
[SYNOPSIS]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user