Skip to content

Commit

Permalink
fix append env vars
Browse files Browse the repository at this point in the history
Signed-off-by: Tianling Shen <[email protected]>
  • Loading branch information
1715173329 committed Sep 16, 2021
1 parent 94b7851 commit 4fc4b6f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LUCI_PKGARCH:=all

PKG_NAME:=luci-app-unblockneteasemusic
PKG_VERSION:=2.11
PKG_RELEASE:=1
PKG_RELEASE:=2

PKG_MAINTAINER:=Tianling Shen <[email protected]>

Expand Down
16 changes: 8 additions & 8 deletions root/etc/init.d/unblockneteasemusic
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ append_param_arg() {
append_param_env() {
local value
config_get value "$1" "$2"
[ -n "$value" ] && procd_set_param env "$3"="$value"
[ -n "$value" ] && procd_append_param env "$3"="$value"
}

uci_get_by_name() {
Expand Down Expand Up @@ -93,23 +93,23 @@ start_service()
append_param_arg "config" "proxy_server_ip" "-u"
is_enabled "config" "strict_mode" && append_param "-s"

procd_set_param env LOG_FILE="/tmp/$NAME.log"

append_param_env "config" "joox_cookie" "JOOX_COOKIE"
append_param_env "config" "migu_cookie" "MIGU_COOKIE"
append_param_env "config" "qq_cookie" "QQ_COOKIE"
append_param_env "config" "youtube_key" "YOUTUBE_KEY"
append_param_env "config" "self_issue_cert_crt" "SIGN_CERT"
append_param_env "config" "self_issue_cert_key" "SIGN_KEY"

is_enabled "config" "enable_flac" && procd_set_param env ENABLE_FLAC="true"
is_enabled "config" "enable_flac" && procd_append_param env ENABLE_FLAC="true"
case "$(config_get "config" "replace_music_source")" in
"lower_than_192kbps") procd_set_param env MIN_BR="192000" ;;
"lower_than_320kbps") procd_set_param env MIN_BR="320000" ;;
"lower_than_999kbps") procd_set_param env MIN_BR="600000" ;;
"replace_all") procd_set_param env MIN_BR="9999999" ;;
"lower_than_192kbps") procd_append_param env MIN_BR="192000" ;;
"lower_than_320kbps") procd_append_param env MIN_BR="320000" ;;
"lower_than_999kbps") procd_append_param env MIN_BR="600000" ;;
"replace_all") procd_append_param env MIN_BR="9999999" ;;
esac

procd_set_param env LOG_FILE="/tmp/$NAME.log"

procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param respawn
Expand Down

0 comments on commit 4fc4b6f

Please sign in to comment.