From 01b0a486d1190b88ee40458b4e16bcd6fa0c93bc Mon Sep 17 00:00:00 2001 From: awy Date: Mon, 26 Aug 2024 02:36:04 +0300 Subject: posix compliant root check --- rice.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rice.sh b/rice.sh index d4a7e50..d00146e 100755 --- a/rice.sh +++ b/rice.sh @@ -1,7 +1,9 @@ +#!/bin/sh + WORKDIRECTORY=$PWD PERMUSER="awy" -if [ "$EUID" -ne 0 ] +if [ "$(id -u)" -ne 0 ] then printf "The script has to be run as root.\n" exit fi -- cgit v1.2.3