Update nixos-infect

This commit is contained in:
Dominik Gleich 2023-12-08 06:50:04 +01:00 committed by GitHub
parent 25d753abc7
commit af9f34ecbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,7 +20,7 @@ makeConf() {
local IFS=$'\n' local IFS=$'\n'
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|sk-ssh|sk-ecdsa)-[^[:space:]]+)[[:space:]]+([^[:space:]]+)([[:space:]]*.*)$/\1 \3\4/' "$trypath") \ && keys=$(sed -E 's/^.* ((sk-ssh|sk-ecdsa|ssh|ecdsa)-[^[:space:]]+)[[:space:]]+([^[:space:]]+)([[:space:]]*.*)$/\1 \3\4/' "$trypath") \
&& [[ ! -z "$keys" ]] \ && [[ ! -z "$keys" ]] \
&& break && break
done done