Files
systemd/mkosi/mkosi.images/initrd/mkosi.extra/shutdown
T
Maximilian Bosch db5f1952f3 mkosi: /bin/bash -> /usr/bin/env bash
This is analogous to a change in mkosi[1] with the same motivation: some
scripts are run to bootstrap the distribution tree and are thus running
directly on the host system which may not have `/bin/bash` (e.g. NixOS).

As with the `mkosi` change, do that for each shebang for consistency
reasons.

[1] https://github.com/systemd/mkosi/commit/8d2cd50e5192cada7211724ecff3514f0c85cf0f
2026-01-11 06:57:49 +01:00

13 lines
332 B
Bash
Executable File

#!/usr/bin/env bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -eux
EXIT_CODE=()
# Translate a successful exit code to 124 so that we can detect that the exitrd was actually used.
if [[ "$*" == *"--exit-code=123"* ]]; then
EXIT_CODE+=("--exit-code=124")
fi
exec /usr/lib/systemd/systemd-shutdown "$@" "${EXIT_CODE[@]}"