2015-11-13 05:32:44 +01:00
#!/bin/sh
# This script should open some GUI to install updates.
# If you are creating package for other distribution, feel free to replace it
# with distribution-specific script.
2017-09-30 04:45:31 +02:00
if [ -e /etc/redhat-release ] && [ -x /usr/bin/dnf ]; then
2016-11-12 22:21:42 +01:00
update_cmd='dnf update --best'
2017-09-30 04:45:31 +02:00
elif [ -e /etc/redhat-release ] && [ -x /usr/bin/yum ]; then
2016-11-12 22:21:42 +01:00
update_cmd='yum update'
2015-11-13 05:32:44 +01:00
elif [ -e /etc/debian_version ]; then
2016-11-12 22:21:42 +01:00
update_cmd='apt-get update && apt-get -V dist-upgrade'
2017-09-30 04:45:31 +02:00
elif [ -e /etc/arch-release ] && [ -x /usr/bin/powerpill ]; then
2016-11-12 22:30:37 +01:00
update_cmd='powerpill -Suy'
2016-01-16 11:52:49 +01:00
elif [ -e /etc/arch-release ]; then
2016-11-12 22:21:42 +01:00
update_cmd='pacman -Suy'
2015-11-13 05:32:44 +01:00
else
2016-11-12 22:21:42 +01:00
update_cmd='echo Unsupported distribution, install updates manually; bash -i'
2015-11-13 05:32:44 +01:00
fi
2019-07-05 20:38:04 +02:00
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; } ;"
2016-11-12 22:21:42 +01:00
2015-11-13 05:32:44 +01:00
# Notify dom0 about installed updates
2019-07-05 20:38:04 +02:00
su -s /bin/sh -c 'service qubes-update-check start'