Fix migration when SSH server settings exist

This fix #1015
This commit is contained in:
Mattias Walström
2025-04-11 14:05:53 +02:00
parent d877806e2b
commit 454207c185
+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