diff --git a/dom0/qvm-tools/qvm-dom0-update b/dom0/qvm-tools/qvm-dom0-update index 1f261e39..50007871 100755 --- a/dom0/qvm-tools/qvm-dom0-update +++ b/dom0/qvm-tools/qvm-dom0-update @@ -17,6 +17,12 @@ if [ "$1" = "--help" ]; then exit fi +ID=$(id -ur) +if [ $ID != 0 ] ; then + echo "This script should be run as root, use sudo." + exit +fi + # We should ensure the clocks in Dom0 and UpdateVM are in sync # becuase otherwise yum might complain about future timestamps qvm-sync-dom0-clock @@ -49,25 +55,11 @@ while [ $# -gt 0 ]; do done if [ "x$PKGS" != "x" ]; then - ID=$(id -ur) - if [ $ID != 0 ] ; then - echo "This script should be run as root, use sudo next time." - echo "Now you can manually run yum install (use sudo again)." - exit - fi - yum $OPTS install $PKGS elif [ -f /var/lib/qubes/updates/repodata/repomd.xml ]; then # Above file exists only when at least one package was downloaded yum check-update if [ $? -eq 100 ]; then - - ID=$(id -ur) - if [ $ID != 0 ] ; then - echo "This script should be run as root, use sudo next time." - echo "Now you can manually run yum update (use sudo again)." - exit - fi yum $OPTS update fi else