diff --git a/script-functions b/script-functions index fe1f35d5..102dcf71 100644 --- a/script-functions +++ b/script-functions @@ -21,8 +21,7 @@ ask_ok() { } is_root() { - user=$(whoami) - [[ $user != "root" ]] && echo "Script must be run with sudo" && exit 1 + [[ $EUID -gt 0 ]] && echo "Script must be run with sudo" && exit 1 } copy_manual() { diff --git a/script-user-reset-display b/script-user-reset-display index 6487e85b..c75bcfae 100755 --- a/script-user-reset-display +++ b/script-user-reset-display @@ -9,7 +9,7 @@ parent=${parent%/*} echo "This script will only work for the current user" -is_root && echo "Do not run as root (do not use sudo)" && exit 1 +[[ $EUID -eq 0 ]] && echo "Do not run as root (do not use sudo)" && exit 1 to_reset=( /org/mate/panel/