From a4b0e5d5cb75ff4af2054ed8df28bb10fe92e16a Mon Sep 17 00:00:00 2001 From: kaotisk Date: Wed, 23 Aug 2023 19:14:44 +0300 Subject: Dynamic sudo usage --- install.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'install.sh') diff --git a/install.sh b/install.sh index b434cef..6255de0 100755 --- a/install.sh +++ b/install.sh @@ -58,6 +58,16 @@ checkPkgManager(){ } checkPkgManager +sudoBin="sudo" +checkIfSudoAvailable(){ + which sudo + if [ $? -ne 0 ] + then + sudoBin="" + fi +} +checkIfSudoAvailable + # Depedencies check and install declare -a depedencies=("curl" "wget" "bash" "jq" "nodejs" "npm" "gpg" "git") for dep in "${depedencies[@]}" -- cgit v1.2.3