mirror of
https://github.com/elitak/nixos-infect
synced 2024-11-10 05:54:20 +00:00
check if ssh keys variable is populated after parsing file (#148)
This commit is contained in:
parent
0878853cbc
commit
e01d2272dc
1 changed files with 1 additions and 0 deletions
|
@ -21,6 +21,7 @@ makeConf() {
|
||||||
for trypath in /root/.ssh/authorized_keys /home/$SUDO_USER/.ssh/authorized_keys $HOME/.ssh/authorized_keys; do
|
for trypath in /root/.ssh/authorized_keys /home/$SUDO_USER/.ssh/authorized_keys $HOME/.ssh/authorized_keys; do
|
||||||
[[ -r "$trypath" ]] \
|
[[ -r "$trypath" ]] \
|
||||||
&& keys=$(sed -E 's/^.*((ssh|ecdsa)-[^[:space:]]+)[[:space:]]+([^[:space:]]+)([[:space:]]*.*)$/\1 \3\4/' "$trypath") \
|
&& keys=$(sed -E 's/^.*((ssh|ecdsa)-[^[:space:]]+)[[:space:]]+([^[:space:]]+)([[:space:]]*.*)$/\1 \3\4/' "$trypath") \
|
||||||
|
&& [[ ! -z "$keys" ]] \
|
||||||
&& break
|
&& break
|
||||||
done
|
done
|
||||||
local network_import=""
|
local network_import=""
|
||||||
|
|
Loading…
Reference in a new issue