Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/nixos-anywhere.sh
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,29 @@ SSH

nixosReboot() {
step Rebooting

# disable debug output temporarily to prevent log spam
set +x

local inhibited
inhibited=$(
runSsh sh <<SSH
if command -v systemd-inhibit 2>/dev/null; then
systemd-inhibit --list | grep "shutdown"
fi
SSH
)
if [[ -n "${inhibited}" ]]; then
echo "WARNING: Reboot is currently inhibited. Manual reboot may be required. Run 'systemd-inhibit --list' on the target for further details" 2>&1
if [[ -n ${enableDebug} ]]; then
echo "${inhibited}" 2>&1
fi
fi

if [[ -n ${enableDebug} ]]; then
set -x
fi

runSsh sh <<SSH
if command -v zpool >/dev/null && [ "\$(zpool list)" != "no pools available" ]; then
# we always want to export the zfs pools so people can boot from it without force import
Expand Down
Loading