#5 fix check for root permissions
Merged 2 years ago by pbrobinson. Opened 2 years ago by hrw.
hrw/arm-image-installer master  into  master

fix check for root permissions
Marcin Juszkiewicz • 2 years ago  
file modified
+1 -1

@@ -157,7 +157,7 @@ 

  fi

  

  # ensure sudo user

- if [ "$(sudo whoami)" != "root" ] ; then

+ if [ "$(whoami)" != "root" ] ; then

          echo "Error: This script requires 'sudo' privileges in order to write to disk & mount media."

          exit 1

  fi

file modified
+2 -2

@@ -48,8 +48,8 @@ 

          shift

  done

  

- # ensure user

- if [ "$(sudo whoami)" != "root" ] ; then

+ # ensure sudo user

+ if [ "$(whoami)" != "root" ] ; then

          echo "Error: This script requires 'sudo' privileges in order to write to disk & mount media."

          exit 1

  fi

existing check was useless as it checked does sudo works correctly not is script running under sudo.

Pull-Request has been merged by pbrobinson

2 years ago