aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-09-12 09:39:35 +0200
committerGravatar Christian Hesse <mail@eworm.de>2024-09-12 10:39:59 +0200
commit160787bf6279748903ad6e2fa4264afcf078af41 (patch)
tree7a301597c8a295bb7c2b743eec0c6ab57cad9533
parent29b4a42b092b97224020636582a300db6f106dd8 (diff)
downloadpacman-offline-160787bf6279748903ad6e2fa4264afcf078af41.tar.gz
pacman-offline-160787bf6279748903ad6e2fa4264afcf078af41.tar.zst
deny action if running in chroot
-rwxr-xr-xbin/pacman-offline5
1 files changed, 5 insertions, 0 deletions
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