optimize envs_user_info.sh

This commit is contained in:
creme 2020-02-16 14:50:14 +01:00
parent ede595afe0
commit 1d6df5a4ec
Signed by: creme
GPG Key ID: C147C3B7FBDF08D0
1 changed files with 3 additions and 3 deletions

View File

@ -192,10 +192,9 @@ EOM
fi
fi
done
fi
# ssh
# only print ssh-pubkey if user has enabled
if [ -f "$INFO_FILE" ]; then
# only print ssh-pubkey if user has enabled
ssh_pubkey="$(sed -n '/^ssh_pubkey=/{s#^.*=##;p}' "$INFO_FILE")"
if [[ "$ssh_pubkey" =~ [yY1] ]]; then
cat << EOM >> "$TMP_JSON"
@ -214,6 +213,7 @@ EOM
# remove trailing ',' (no ssh-pubkey print out)
clear_lastline
fi
## if line 118
else
# no "$INFO_FILE" file
# remove trailing ',' for the last user entry