From d15ebb2ffe336697f440d3c79efbe823fab967e6 Mon Sep 17 00:00:00 2001 From: pnetlabrepo <115958905+pnetlabrepo@users.noreply.github.com> Date: Wed, 8 Feb 2023 05:13:08 -0300 Subject: [PATCH] Update ishare2 --- ishare2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ishare2 b/ishare2 index d9bd56a..c8f24d5 100644 --- a/ishare2 +++ b/ishare2 @@ -38,9 +38,9 @@ function set_url_constants() { } function check_user_is_root() { - user=$(whoami) - if [[ "$user" != "root" ]]; then - echo -e "${RED}[!] This script requires root privileges to execute. The current user, "$user", does not have sufficient permissions. Please switch to the root user to run the script.${NO_COLOR}" + if ! [[ "$(id -u)" == 0 ]]; then + user=$(whoami) + echo -e "${RED}[!] This script requires root privileges to be executed. The current user, "$user", does not have enough permissions. Please, switch to the root user to run the script.${NO_COLOR}" exit 1 fi }