diff --git a/doc/ChangeLog.md b/doc/ChangeLog.md index eea3fe3ee..a4862d949 100644 --- a/doc/ChangeLog.md +++ b/doc/ChangeLog.md @@ -15,6 +15,7 @@ All notable changes to the project are documented in this file. - Fix #1002: Broken symlink in release package - Fix #1006: NanoPi R2S corrupt startup, regression in Infix v25.02.0 - Bump R2S kernel, now same as tier one boards + - Fix #1015: Not possible to save custom SSH settings in startup-config - Fix group owner and permissions of `/cfg/backup` directory - Fix extraction of old version for `/cfg/backup/` files diff --git a/src/confd/share/migrate/1.3/10-ssh-server.sh b/src/confd/share/migrate/1.3/10-ssh-server.sh index c6c0b02bb..465ab0834 100755 --- a/src/confd/share/migrate/1.3/10-ssh-server.sh +++ b/src/confd/share/migrate/1.3/10-ssh-server.sh @@ -3,14 +3,17 @@ file=$1 temp=${file}.tmp - -jq '.["infix-services:ssh"] = { - "enabled": true, - "hostkey": ["genkey"], - "listen": [ - {"name": "ipv4", "address": "0.0.0.0", "port": 22}, - {"name": "ipv6", "address": "::", "port": 22} - ] - }' "$file" > "$temp" - -mv "$temp" "$file" +jq ' +if has("infix-services:ssh") then + . +else + .["infix-services:ssh"] = { + "enabled": true, + "hostkey": ["genkey"], + "listen": [ + {"name": "ipv4", "address": "0.0.0.0", "port": 22}, + {"name": "ipv6", "address": "::", "port": 22} + ] + } +end' $file > temp.json +mv temp.json $file