From 15f36551add0980bf1b1cc13558f281acc8b7418 Mon Sep 17 00:00:00 2001 From: Alexander Tomokhov Date: Thu, 28 Dec 2023 20:00:44 +0400 Subject: [PATCH] fix: absent SSH_AUTHORIZED_KEY does not cause failure --- nixos-infect | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos-infect b/nixos-infect index a4f6fc5..c16a548 100755 --- a/nixos-infect +++ b/nixos-infect @@ -30,9 +30,11 @@ readonly NIX_OPTS=(--extra-experimental-features "nix-command flakes") DoNetConf= genOptionalSsh() { - [ -n "${SSH_AUTHORIZED_KEY}" ] && cat << EOF + if [ -n "${SSH_AUTHORIZED_KEY}" ]; then + cat << EOF "ssh": { "rootKeys": [ "${SSH_AUTHORIZED_KEY}" ] }, EOF + fi } # TODO receive disk device path from outside @@ -528,8 +530,6 @@ set -o xtrace shopt -s inherit_errexit trap 'echo ${LINENO}: "$BASH_COMMAND"; exit 1' ERR -genNetworkingConf - # digitalocean requires detailed network config to be generated [ "$PROVIDER" == "digitalocean" ] && DoNetConf="y"