mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-01 05:13:01 +02:00
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user