summaryrefslogtreecommitdiffstats
path: root/virt-what.in
diff options
context:
space:
mode:
Diffstat (limited to 'virt-what.in')
-rw-r--r--virt-what.in3
1 files changed, 1 insertions, 2 deletions
diff --git a/virt-what.in b/virt-what.in
index d62f7c8..cc5c93c 100644
--- a/virt-what.in
+++ b/virt-what.in
@@ -75,8 +75,7 @@ PATH=$root@libexecdir@:$root/sbin:$root/usr/sbin:$PATH
# Check we're running as root.
-uid=`id -u`
-if [ "$uid" != 0 ]; then
+if [ "x$root" = "x" ] && [ "$EUID" -ne 0 ]; then
fail "this script must be run as root"
fi