|
3 | 3 | ## Copyright (C) 2019 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org> |
4 | 4 | ## See the file COPYING for copying conditions. |
5 | 5 |
|
6 | | -set -o errexit |
7 | | -set -o nounset |
8 | | -set -o errtrace |
9 | | -set -o pipefail |
| 6 | +set -e |
10 | 7 |
|
11 | | -if [ "$(id -u)" = "0" ]; then |
12 | | - ## Administrative ("root") rights already available. |
13 | | - ## No need to use a privilege escalation tool such as 'privleap' or 'sudo'. |
14 | | - exec /usr/bin/apt-get-update-plus dist-upgrade |
15 | | -fi |
16 | | - |
17 | | -## This is never reached if running 'exec' above. |
18 | | - |
19 | | -# shellcheck source=../../../helper-scripts/usr/libexec/helper-scripts/use_leaprun.sh |
20 | | -source /usr/libexec/helper-scripts/use_leaprun.sh |
21 | | -if [ "${use_leaprun}" = 'yes' ]; then |
22 | | - exec "${leaprun_exe}" upgrade-nonroot-wrapper |
23 | | -fi |
24 | | - |
25 | | -## In practice, this should "rarely" be reached. |
26 | | -## Only in case after upgrade, when privleap has not been started yet. |
27 | | -## In a future version, privleap might auto start after installation. |
28 | | -## Then this should "never" be reached. |
29 | | - |
30 | | -# shellcheck source=../../../../helper-scripts/usr/libexec/helper-scripts/package_installed_check.bsh |
| 8 | +# shellcheck source=../../../helper-scripts/usr/libexec/helper-scripts/package_installed_check.bsh |
31 | 9 | source /usr/libexec/helper-scripts/package_installed_check.bsh |
32 | | -if pkg_installed user-sysmaint-split ; then |
33 | | - if command -v qubesdb-read >/dev/null 2>&1 ; then |
34 | | - 1>&2 echo "$0: Cannot run \"apt-get-update-plus dist-upgrade\". Please open a Qubes root console. See: https://www.kicksecure.com/wiki/sysmaint" |
35 | | - else |
36 | | - kernel_cmdline="$(cat /proc/cmdline)" |
37 | | - if ! [[ "${kernel_cmdline}" =~ 'boot-role=sysmaint' ]]; then |
38 | | - 1>&2 echo "$0: Cannot run \"apt-get-update-plus dist-upgrade\". Please reboot into \"PERSISTENT mode SYSMAINT\" to do this. See: https://www.kicksecure.com/wiki/sysmaint" |
39 | | - fi |
| 10 | + |
| 11 | +if pkg_installed user-sysmaint-split; then |
| 12 | + if [ "$(id -un)" != 'sysmaint' ]; then |
| 13 | + 1>&2 echo "ERROR: upgrade-nonroot cannot be used by accounts other than" |
| 14 | + 1>&2 echo "'sysmaint' on this system. For more information, see" |
| 15 | + 1>&2 echo "https://www.kicksecure.com/wiki/Sysmaint" |
| 16 | + exit 1 |
40 | 17 | fi |
41 | | - exit 1 |
42 | 18 | fi |
43 | 19 |
|
44 | | -## This is never reached if running 'exec' above. |
45 | | - |
46 | | -exec sudo /usr/bin/apt-get-update-plus dist-upgrade |
| 20 | +sudo /usr/bin/apt-get-update-plus dist-upgrade |
0 commit comments