luci-app-baidupcs-web: Fix startup error (#189)

Fixed the problem that the service failed to start

Signed-off-by: Yu Hua <hue715@gmail.com>
This commit is contained in:
Yu Hua 2023-02-10 00:51:21 +08:00 committed by GitHub
parent c89907da5a
commit 9fc2e3466b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,8 @@
START=90
STOP=10
BaiduPCSWeb="/usr/bin/baidupcs-web"
enabled="$(uci -q get baidupcs-web.config.enabled)"
port="$(uci -q get baidupcs-web.config.port)"
download_dir="$(uci -q get baidupcs-web.config.download_dir)"
@ -15,7 +17,7 @@ start() {
stop
[ "$enabled" == "1" ] || exit 0
mkdir -p "${download_dir}"
baidupcs-web config set \
"${BaiduPCSWeb}" config set \
--savedir "${download_dir}" \
--max_download_rate "${max_download_rate}" \
--max_upload_rate "${max_upload_rate}" \
@ -24,9 +26,9 @@ start() {
--max_upload_parallel "${max_parallel}" \
>/dev/null 2>&1
baidupcs-web web --port "${port}" --access >/dev/null 2>&1 &
"${BaiduPCSWeb}" web --port "${port}" --access >/dev/null 2>&1 &
}
stop() {
killall baidupcs-web >/dev/null 2>&1
killall "${BaiduPCSWeb}" >/dev/null 2>&1
}