Skip to content

Commit

Permalink
Only require sh, not bash, on the remote machine
Browse files Browse the repository at this point in the history
  • Loading branch information
shlevy committed Feb 27, 2024
1 parent b6abac7 commit fb27d67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/nixos-anywhere.sh
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ done
import_facts() {
local facts filtered_facts
if ! facts=$(
ssh_ -o ConnectTimeout=10 bash -- <<SSH
ssh_ -o ConnectTimeout=10 sh -- <<SSH
set -efu ${enable_debug}
has(){
command -v "\$1" >/dev/null && echo "y" || echo "n"
Expand Down Expand Up @@ -371,7 +371,7 @@ if [[ ${is_kexec-n} == "n" ]] && [[ ${is_installer-n} == "n" ]]; then
fi

step Switching system into kexec
ssh_ bash <<SSH
ssh_ sh <<SSH
set -efu ${enable_debug}
$maybe_sudo rm -rf /root/kexec
$maybe_sudo mkdir -p /root/kexec
Expand Down Expand Up @@ -471,7 +471,7 @@ if [[ -n ${extra_files-} ]]; then
fi

step Installing NixOS
ssh_ bash <<SSH
ssh_ sh <<SSH
set -eu ${enable_debug}
# when running not in nixos we might miss this directory, but it's needed in the nixos chroot during installation
export PATH="\$PATH:/run/current-system/sw/bin"
Expand Down Expand Up @@ -499,7 +499,7 @@ if command -v zpool >/dev/null; then
fi
# We will reboot in background so we can cleanly finish the script before the hosts go down.
# This makes integration into scripts easier
nohup bash -c '${maybe_reboot}' >/dev/null &
nohup sh -c '${maybe_reboot}' >/dev/null &
SSH

if [[ -n ${maybe_reboot} ]]; then
Expand Down

0 comments on commit fb27d67

Please sign in to comment.