X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=virt-what.in;h=297956dfb3259ead6c7f9f72b53e92d08da2a4c5;hb=2f47e06;hp=d62f7c8109187df36f89afc398b8e318826427f7;hpb=a1670e2cb0ec7fd4116cba9c634ba2c92cb3f7e4;p=virt-what.git diff --git a/virt-what.in b/virt-what.in index d62f7c8..297956d 100644 --- a/virt-what.in +++ b/virt-what.in @@ -34,7 +34,7 @@ skip_qemu_kvm=false VERSION="@VERSION@" function fail { - echo "virt-what: $1" + echo "virt-what: $1" >&2 exit 1 } @@ -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 @@ -154,7 +153,7 @@ fi # Check for Hitachi Virtualization Manager (HVM) Virtage logical partitioning. if echo "$dmi" | grep -q 'Manufacturer.*HITACHI' && - echo "$dmi" | grep -q 'Product.*HVM LPAR'; then + echo "$dmi" | grep -q 'Product.* LPAR'; then echo virtage fi