From f5eaf13cbbe385a1934e7fd7777cdb3e6dcbf8ba Mon Sep 17 00:00:00 2001 From: bolvan Date: Wed, 8 May 2019 09:35:03 +0300 Subject: [PATCH] install_easy : fix exit when su/sudo notfound --- install_easy.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/install_easy.sh b/install_easy.sh index 9d44039..125c034 100755 --- a/install_easy.sh +++ b/install_easy.sh @@ -24,14 +24,6 @@ whichq() which $1 2>/dev/null } -[ $(id -u) -ne "0" ] && { - echo root is required - exists sudo && exec sudo $0 - exists su && exec su -c $0 - echo su or sudo not found - exit 2 -} - exitp() { echo @@ -40,6 +32,14 @@ exitp() exit $1 } +[ $(id -u) -ne "0" ] && { + echo root is required + exists sudo && exec sudo $0 + exists su && exec su -c $0 + echo su or sudo not found + exitp 2 +} + get_dir_inode() { ls -id "$1" | cut -f1 -d ' '