From 160787bf6279748903ad6e2fa4264afcf078af41 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 12 Sep 2024 09:39:35 +0200 Subject: deny action if running in chroot --- bin/pacman-offline | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/pacman-offline b/bin/pacman-offline index 5597faf..346e843 100755 --- a/bin/pacman-offline +++ b/bin/pacman-offline @@ -41,6 +41,11 @@ while getopts 'acfhprty' opt; do esac done +if systemd-detect-virt --chroot; then + echo 'Running in chroot, skipping.' >&2 + exit 0 +fi + if [ "${UID}" -ne 0 ]; then if command -v pkexec >/dev/null; then echo 'Missing privileges, trying to elevate.' >&2 -- cgit v1.2.3-70-g09d2