Fix migration when SSH server settings exist

This fix #1015
This commit is contained in:
Mattias Walström
2025-04-10 14:29:56 +02:00
parent 6fe4db8431
commit f2f539b492
2 changed files with 15 additions and 11 deletions
+1
View File
@@ -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
+14 -11
View File
@@ -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