Update ishare2

This commit is contained in:
pnetlabrepo
2023-02-08 05:13:08 -03:00
committed by GitHub
parent 2d24b341bd
commit d15ebb2ffe

View File

@@ -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
}