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.
2016-06-01 04:47:56 +02:00
if [ -e /etc/redhat-release -a -x /usr/bin/dnf ]; then
2016-11-12 22:21:42 +01:00
update_cmd='dnf update --best'
2016-06-01 04:47:56 +02:00
elif [ -e /etc/redhat-release -a -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'
2016-11-12 22:30:37 +01:00
elif [ -e /etc/arch-release -a -x /usr/bin/powerpill ]; then
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
2017-01-14 14:11:27 +01:00
xterm -title update -e su -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
su -c 'service qubes-update-check start'