mirror of
https://github.com/coolsnowwolf/luci
synced 2025-01-07 07:06:41 +08:00
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:
parent
c89907da5a
commit
9fc2e3466b
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user