auto_detect_email can fetch from defaults.yaml

This commit is contained in:
pvincent
2024-03-02 17:16:06 +04:00
parent e317c106d3
commit 9070123470
+2
View File
@@ -433,6 +433,8 @@ function is_email_valid {
function auto_detect_email {
found_email="${EMAIL:-}"
[[ -z "$found_email" ]] && [[ -f /etc/miaou/defaults.yaml ]] && found_email=$(yq '.credential.email' /etc/miaou/defaults.yaml)
[[ "$found_email" == 'null' ]] && found_email=''
if ! is_email_valid "$found_email"; then
if [[ -f $HOME/.ssh/authorized_keys ]]; then
while IFS= read -r line; do