diff --git a/writeimage.sh b/writeimage.sh index 8cdc4db02f..c77327ba84 100755 --- a/writeimage.sh +++ b/writeimage.sh @@ -16,7 +16,7 @@ if [ -z "$1" ]; then usage fi -test "root" != "$USER" && exec sudo $0 "$@" +if [[ $(id -u) -ne 0 ]]; then echo "Please run as root"; exit 1; fi function msg() { echo ":: $1"