From f32a39514e7f5e5c94554291f519be60c1624a5d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 12 Sep 2024 09:41:40 +0200 Subject: deny action if systemd is not booted --- bin/pacman-offline | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bin') diff --git a/bin/pacman-offline b/bin/pacman-offline index 346e843..3d218f9 100755 --- a/bin/pacman-offline +++ b/bin/pacman-offline @@ -46,6 +46,11 @@ if systemd-detect-virt --chroot; then exit 0 fi +if [ ! -d /run/systemd/system ]; then + echo 'Current root is not booted, 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