Update root user check

pull/2633/head
Zhymabek Roman 7 months ago committed by GitHub
parent 7ad91ddc9b
commit eac13d0238
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -20,6 +20,11 @@ if [ -z "$2" ]; then
exit 1
fi
uid=$(id -u)
if [ $uid -ne 0 ]; then
print_err "Please use sudo or run the script as root."
exit 1
fi
if [ "$1" = "__vbash__" ]; then
shift
@ -35,11 +40,6 @@ fi
file=$1
size=$2
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
if [ ! -f "$file" ]; then
echo "$file not exist."
exit 1

Loading…
Cancel
Save