From 7d5d117760c3c289351c6dbcdca390d1bf65dd90 Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Sat, 4 Jun 2022 17:10:41 -0600 Subject: skip sudo if root --- patch_iso.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/patch_iso.sh b/patch_iso.sh index dfda8fa..a6873c0 100755 --- a/patch_iso.sh +++ b/patch_iso.sh @@ -78,8 +78,12 @@ if [[ ERROR -ne 0 ]]; then fi tar -xvf wit.tar.gz cd wit-v*/ - echo "You will now be prompted to enter your password for sudo in order for wit to install." - sudo ./install.sh + if [[ $(id -u) == 0 ]]; then + ./install.sh + else + echo "You will now be prompted to enter your password for sudo in order for wit to install." + sudo ./install.sh + fi cd .. rm -rf wit-v*/ # check if wit is installed now -- cgit v1.2.3