mirror of
https://github.com/233boy/sing-box.git
synced 2026-05-02 22:04:40 +08:00
fix: avoid apk lock conflict by running install_pkg synchronously on Alpine
This commit is contained in:
12
install.sh
12
install.sh
@@ -73,7 +73,7 @@ is_sh_dir=$is_core_dir/sh
|
|||||||
is_sh_repo=$author/$is_core
|
is_sh_repo=$author/$is_core
|
||||||
is_pkg="wget tar bash"
|
is_pkg="wget tar bash"
|
||||||
# Alpine: gcompat provides glibc compatibility for prebuilt binaries
|
# Alpine: gcompat provides glibc compatibility for prebuilt binaries
|
||||||
[[ $cmd =~ apk ]] && is_pkg="$is_pkg gcompat"
|
[[ $cmd =~ apk ]] && is_pkg="$is_pkg gcompat jq"
|
||||||
is_config_json=$is_core_dir/config.json
|
is_config_json=$is_core_dir/config.json
|
||||||
tmp_var_lists=(
|
tmp_var_lists=(
|
||||||
tmpcore
|
tmpcore
|
||||||
@@ -352,17 +352,17 @@ main() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# install dependent pkg
|
# install dependent pkg
|
||||||
install_pkg $is_pkg &
|
if [[ $cmd =~ apk ]]; then
|
||||||
|
install_pkg $is_pkg
|
||||||
|
else
|
||||||
|
install_pkg $is_pkg &
|
||||||
|
fi
|
||||||
|
|
||||||
# jq
|
# jq
|
||||||
if [[ $(type -P jq) ]]; then
|
if [[ $(type -P jq) ]]; then
|
||||||
>$is_jq_ok
|
>$is_jq_ok
|
||||||
else
|
else
|
||||||
jq_not_found=1
|
jq_not_found=1
|
||||||
# Alpine: install jq via apk instead of downloading glibc binary
|
|
||||||
[[ $cmd =~ apk ]] && {
|
|
||||||
apk add jq &>/dev/null && jq_not_found= && >$is_jq_ok
|
|
||||||
}
|
|
||||||
fi
|
fi
|
||||||
# if wget installed. download core, sh, jq, get ip
|
# if wget installed. download core, sh, jq, get ip
|
||||||
[[ $is_wget ]] && {
|
[[ $is_wget ]] && {
|
||||||
|
|||||||
Reference in New Issue
Block a user