mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-14 20:48:17 +08:00
fix(filebrowser-q): migrate legacy Quantum config
This commit is contained in:
1 parent
19ee99b240
commit
1ce9006a9a
1 file changed
+15
@@ -46,6 +46,21 @@ userDefaults:
|
||||
locale: "zhCN"
|
||||
EOF
|
||||
else
|
||||
# Migrate config files generated by older package versions.
|
||||
if grep -q '^ database: "' "$CONF_PATH"; then
|
||||
sed -i \
|
||||
-e "s/^server:$/http:\\n port: $listen_port\\nserver:/" \
|
||||
-e "/^ port:/d" \
|
||||
-e 's,^ database: "\(.*\)", database:\n path: "\1",' \
|
||||
-e '/^auth:$/a\
|
||||
methods:\
|
||||
password:\
|
||||
enabled: true' \
|
||||
-e 's/^ adminUsername:/ adminUsername:/' \
|
||||
-e 's/^ adminPassword:/ adminPassword:/' \
|
||||
"$CONF_PATH"
|
||||
fi
|
||||
|
||||
grep -q " name:" "$CONF_PATH" || sed -i "s,.*- path:.*,&\n name: \"\"," "$CONF_PATH"
|
||||
sed -e "s/^ port:.*/ port: $listen_port/" \
|
||||
-e "s, - path:.*, - path: \"$root_path\"," \
|
||||
|
||||
Reference in new issue
Block a user