From e01d2272dcc21bb2d9dfc8a50407f28ccf84dfd4 Mon Sep 17 00:00:00 2001 From: Johan Bloemberg Date: Mon, 5 Jun 2023 11:12:51 +0200 Subject: [PATCH] check if ssh keys variable is populated after parsing file (#148) --- nixos-infect | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos-infect b/nixos-infect index 30c73bb..047f603 100644 --- a/nixos-infect +++ b/nixos-infect @@ -21,6 +21,7 @@ makeConf() { for trypath in /root/.ssh/authorized_keys /home/$SUDO_USER/.ssh/authorized_keys $HOME/.ssh/authorized_keys; do [[ -r "$trypath" ]] \ && keys=$(sed -E 's/^.*((ssh|ecdsa)-[^[:space:]]+)[[:space:]]+([^[:space:]]+)([[:space:]]*.*)$/\1 \3\4/' "$trypath") \ + && [[ ! -z "$keys" ]] \ && break done local network_import=""