check if ssh keys variable is populated after parsing file (#148)

This commit is contained in:
Johan Bloemberg 2023-06-05 11:12:51 +02:00 committed by GitHub
parent 0878853cbc
commit e01d2272dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -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=""