From 710f1dfef8e86d98b6fcf3c107fc7335c4317816 Mon Sep 17 00:00:00 2001 From: Solene Rapenne Date: Sun, 15 Aug 2021 21:01:50 +0200 Subject: [PATCH] check if user is root --- pkgupdate | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgupdate b/pkgupdate index 23512cc..371d2f5 100755 --- a/pkgupdate +++ b/pkgupdate @@ -74,6 +74,12 @@ then exit 1 fi +if [ "$(id -u)" -ne 0 ] +then + echo "You need to run $0 as root" + exit 1 +fi + case "$INSTALLURL" in http://*) do_http "http://" ;;