qubes.InstallUpdatesGUI 1.1 KB

123456789101112131415161718192021222324252627
  1. #!/bin/sh
  2. # This script should open some GUI to install updates.
  3. # If you are creating package for other distribution, feel free to replace it
  4. # with distribution-specific script.
  5. if [ -e /etc/redhat-release ] && [ -x /usr/bin/dnf ]; then
  6. update_cmd='dnf update --best'
  7. elif [ -e /etc/redhat-release ] && [ -x /usr/bin/yum ]; then
  8. update_cmd='yum update'
  9. elif [ -e /etc/debian_version ]; then
  10. update_cmd='apt-get update && apt-get -V dist-upgrade'
  11. elif [ -e /etc/arch-release ] && [ -x /usr/bin/powerpill ]; then
  12. update_cmd='powerpill -Suy'
  13. elif [ -e /etc/arch-release ]; then
  14. update_cmd='pacman -Suy'
  15. else
  16. update_cmd='echo Unsupported distribution, install updates manually; bash -i'
  17. fi
  18. xterm -title update -e su -s /bin/sh -l -c "$update_cmd; echo Done.; test -f /var/run/qubes/this-is-templatevm && { echo Press Enter to shutdown the template, or Ctrl-C to just close this window; read x && poweroff; } ;"
  19. # Notify dom0 about installed updates
  20. if [ -e /etc/arch-release ]; then
  21. su -s /bin/sh -c 'systemctl start qubes-update-check'
  22. else
  23. su -s /bin/sh -c 'service qubes-update-check start'
  24. fi