mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-19 06:32:58 +08:00
update 2026-11-15 01:34:46
This commit is contained in:
1 parent
65e90c00b3
commit
ae96c37c6b
2 files changed
+4
-4
No files matched your search
@@ -3,4 +3,4 @@ config filebrowser 'config'
|
||||
option listen_port '8787'
|
||||
option root_path '/'
|
||||
option cacheDir '/tmp'
|
||||
option cacheDirMaxSizeMB '500'
|
||||
option cacheDirMaxSizeMB '300'
|
||||
@@ -15,11 +15,11 @@ start_service() {
|
||||
config_get_bool enabled "config" "enabled" "0"
|
||||
[ "$enabled" -eq "1" ] || return 1
|
||||
|
||||
local listen_port root_path root_name adminUsername adminPassword cacheDir cacheDirMaxSizeMB
|
||||
local listen_port root_path root_name cacheDir cacheDirMaxSizeMB
|
||||
config_get listen_port "config" "listen_port" "8787"
|
||||
config_get root_path "config" "root_path" "/"
|
||||
config_get cacheDir "config" "cacheDir" "/tmp"
|
||||
config_get cacheDirMaxSizeMB "config" "cacheDirMaxSizeMB" "500"
|
||||
config_get cacheDirMaxSizeMB "config" "cacheDirMaxSizeMB" "300"
|
||||
|
||||
root_name=""
|
||||
[ "$root_path" = "/" ] && root_name="root"
|
||||
@@ -42,7 +42,6 @@ server:
|
||||
config:
|
||||
defaultEnabled: true
|
||||
cacheDir: "$cacheDir"
|
||||
cacheDirCleanup: true
|
||||
cacheDirMaxSizeMB: $cacheDirMaxSizeMB
|
||||
auth:
|
||||
methods:
|
||||
@@ -55,6 +54,7 @@ userDefaults:
|
||||
locale: "zhCN"
|
||||
EOF
|
||||
else
|
||||
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\"," \
|
||||
-e "s/ name: \".*\"/ name: \"$root_name\"/" \
|
||||
|
||||
Reference in new issue
Block a user