Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
woniuzfb committed Oct 5, 2024
1 parent 70ecfc1 commit bad65c9
Show file tree
Hide file tree
Showing 72 changed files with 1,836 additions and 328 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- [LianHuanHua](#lianhuanhua)
- [Docker](#docker)
- [HAProxy](#haproxy)
- [tests](#tests)
- [Dev](#dev)

</details>
Expand Down Expand Up @@ -360,6 +361,12 @@ wget https://woniuzfb.github.io/iptv/iptv.sh && bash iptv.sh

</details>

## tests

```bash
./debug tt
```

## Dev

v2.0.0 broken atm
Expand Down
8 changes: 4 additions & 4 deletions debug
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ then
if [ "$debug_options_index" -eq 0 ]
then
echo
inquirer list_input_index "是否部署" ny_options ny_options_index
inquirer list_input_index "是否部署" ny_options ny_index

if [ "$ny_options_index" -eq 0 ]
if [ "$ny_index" -eq 0 ]
then
"$DEV_PATH"/make
else
Expand All @@ -69,9 +69,9 @@ then
inquirer list_input "选择测试的程序" self_options self

echo
inquirer text_input "输入参数" args_input "$i18n_not_set"
inquirer text_input "输入参数" args_input "$i18n_blank"

if [ "$args_input" == "$i18n_not_set" ]
if [ "$args_input" == "$i18n_blank" ]
then
args=()
else
Expand Down
19 changes: 14 additions & 5 deletions docs/iptv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2466,11 +2466,18 @@ inquirer()

trap inquirer:control_c EXIT

read -e text_input

until validate_failed_msg=$($text_input_validator "$text_input")
do
inquirer:print "\n${bg_black}${red}${validate_failed_msg:-$text_input_validate_failed_msg}${normal}\n\n"
read -e text_input
done

#stty -echo
#tput cnorm

read -e text_input
#inquirer:on_keypress inquirer:on_default inquirer:on_default inquirer:on_text_input_ascii inquirer:on_text_input_enter inquirer:on_text_input_left inquirer:on_text_input_right inquirer:on_text_input_ascii inquirer:on_text_input_backspace inquirer:on_text_input_not_ascii

read -r ${var_name?} <<< "${text_input:-$text_default}"

inquirer:cleanup
Expand Down Expand Up @@ -31995,9 +32002,11 @@ AcmeCheck()
if [ ! -f "$HOME/.acme.sh/acme.sh" ]
then
DepInstall socat
{ curl -s -m 10 https://get.acme.sh || curl -s -m 20 "$FFMPEG_MIRROR_LINK/acme.sh"; } \
{ curl -s -m 20 https://raw.githubusercontent.com/acmesh-official/acme.sh/master/acme.sh || curl -s -m 20 "$FFMPEG_MIRROR_LINK/acme.sh"; } \
| sed "s+https://raw.githubusercontent.com/acmesh-official+$FFMPEG_MIRROR_LINK/acmesh-content+g" \
| sed "s+| sh+| sed 's~PROJECT=\"https://github.com/acmesh-official~PROJECT=\"$FFMPEG_MIRROR_LINK/acmesh-project~' | sed 's~https://api.github.com~$FFMPEG_MIRROR_LINK/acmesh-api~g' | sh+g" | bash
| sed "s+| sh+| sed 's~PROJECT=\"https://github.com/acmesh-official~PROJECT=\"$FFMPEG_MIRROR_LINK/acmesh-project~' | sed 's~https://api.github.com~$FFMPEG_MIRROR_LINK/acmesh-api~g' | sh+g" > ~/acme.sh
cd ~
bash acme.sh --install
else
echo
inquirer list_input_index "更新 acme.sh" ny_options ny_options_index
Expand Down Expand Up @@ -53578,7 +53587,7 @@ then
fi

Println "$info 下载 acme.sh ..."
if curl -s -L https://get.acme.sh -o "$FFMPEG_MIRROR_ROOT/acme.sh_tmp"
if curl -s -L https://raw.githubusercontent.com/acmesh-official/acme.sh/master/acme.sh -o "$FFMPEG_MIRROR_ROOT/acme.sh_tmp"
then
mv "$FFMPEG_MIRROR_ROOT/acme.sh_tmp" "$FFMPEG_MIRROR_ROOT/acme.sh"
else
Expand Down
19 changes: 14 additions & 5 deletions iptv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2466,11 +2466,18 @@ inquirer()

trap inquirer:control_c EXIT

read -e text_input

until validate_failed_msg=$($text_input_validator "$text_input")
do
inquirer:print "\n${bg_black}${red}${validate_failed_msg:-$text_input_validate_failed_msg}${normal}\n\n"
read -e text_input
done

#stty -echo
#tput cnorm

read -e text_input
#inquirer:on_keypress inquirer:on_default inquirer:on_default inquirer:on_text_input_ascii inquirer:on_text_input_enter inquirer:on_text_input_left inquirer:on_text_input_right inquirer:on_text_input_ascii inquirer:on_text_input_backspace inquirer:on_text_input_not_ascii

read -r ${var_name?} <<< "${text_input:-$text_default}"

inquirer:cleanup
Expand Down Expand Up @@ -31995,9 +32002,11 @@ AcmeCheck()
if [ ! -f "$HOME/.acme.sh/acme.sh" ]
then
DepInstall socat
{ curl -s -m 10 https://get.acme.sh || curl -s -m 20 "$FFMPEG_MIRROR_LINK/acme.sh"; } \
{ curl -s -m 20 https://raw.githubusercontent.com/acmesh-official/acme.sh/master/acme.sh || curl -s -m 20 "$FFMPEG_MIRROR_LINK/acme.sh"; } \
| sed "s+https://raw.githubusercontent.com/acmesh-official+$FFMPEG_MIRROR_LINK/acmesh-content+g" \
| sed "s+| sh+| sed 's~PROJECT=\"https://github.com/acmesh-official~PROJECT=\"$FFMPEG_MIRROR_LINK/acmesh-project~' | sed 's~https://api.github.com~$FFMPEG_MIRROR_LINK/acmesh-api~g' | sh+g" | bash
| sed "s+| sh+| sed 's~PROJECT=\"https://github.com/acmesh-official~PROJECT=\"$FFMPEG_MIRROR_LINK/acmesh-project~' | sed 's~https://api.github.com~$FFMPEG_MIRROR_LINK/acmesh-api~g' | sh+g" > ~/acme.sh
cd ~
bash acme.sh --install
else
echo
inquirer list_input_index "更新 acme.sh" ny_options ny_options_index
Expand Down Expand Up @@ -53578,7 +53587,7 @@ then
fi

Println "$info 下载 acme.sh ..."
if curl -s -L https://get.acme.sh -o "$FFMPEG_MIRROR_ROOT/acme.sh_tmp"
if curl -s -L https://raw.githubusercontent.com/acmesh-official/acme.sh/master/acme.sh -o "$FFMPEG_MIRROR_ROOT/acme.sh_tmp"
then
mv "$FFMPEG_MIRROR_ROOT/acme.sh_tmp" "$FFMPEG_MIRROR_ROOT/acme.sh"
else
Expand Down
4 changes: 2 additions & 2 deletions src/_4gtv/start_link
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ Start4gtvLink()
then
choose_asked=true
echo
inquirer list_input_index "是否按分辨率自动选择" yn_options yn_options_index
inquirer list_input_index "是否按分辨率自动选择" yn_options yn_index

if [ "$yn_options_index" -eq 0 ]
if [ "$yn_index" -eq 0 ]
then
i=$((i-1))
continue
Expand Down
4 changes: 2 additions & 2 deletions src/_4gtv/use_proxy
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Use4gtvProxy()
GetDefault
d_4gtv_proxy=${d_4gtv_proxy:-$d_proxy}
Println "$tip 可以使用脚本自带的 v2ray 管理面板添加代理, 可以输入 omit 省略此选项"
inquirer text_input "请输入 4gtv 代理, 比如 http://username:passsword@127.0.0.1:5555 : " _4gtv_proxy "${d_4gtv_proxy:-$i18n_not_set}"
if [ "$_4gtv_proxy" == "omit" ] || [ "$_4gtv_proxy" == "$i18n_not_set" ]
inquirer text_input "请输入 4gtv 代理, 比如 http://username:passsword@127.0.0.1:5555 : " _4gtv_proxy "${d_4gtv_proxy:-$i18n_blank}"
if [ "$_4gtv_proxy" == "omit" ] || [ "$_4gtv_proxy" == "$i18n_blank" ]
then
_4gtv_proxy=""
_4gtv_proxy_command=()
Expand Down
4 changes: 2 additions & 2 deletions src/alist/acc
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ AlistAccAdd()
ExitOnText "输入登录名" alist_acc_username

echo
inquirer text_input "输入密码" alist_acc_password "$i18n_not_set"
inquirer text_input "输入密码" alist_acc_password "$i18n_blank"

if [ "$alist_acc_password" == "$i18n_not_set" ]
if [ "$alist_acc_password" == "$i18n_blank" ]
then
alist_acc_password=""
fi
Expand Down
8 changes: 4 additions & 4 deletions src/alist/act
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ AlistAct()
if [ -n "${alist_accs_token[alist_accs_index]}" ]
then
echo
inquirer list_input_index "是否重新登陆账号" ny_options ny_options_index
inquirer list_input_index "是否重新登陆账号" ny_options ny_index

if [ "$ny_options_index" -eq 0 ]
if [ "$ny_index" -eq 0 ]
then
alist_acc_token="${alist_accs_token[alist_accs_index]}"
else
Expand Down Expand Up @@ -248,9 +248,9 @@ AlistAct()
done

Println "$alist_files_txt\n"
inquirer list_input_index "确认删除以上文件" ny_options ny_options_index
inquirer list_input_index "确认删除以上文件" ny_options ny_index

if [ "$ny_options_index" -eq 1 ]
if [ "$ny_index" -eq 1 ]
then
for alist_file_delete_name in "${alist_files_delete_names[@]}"
do
Expand Down
4 changes: 2 additions & 2 deletions src/alist/app
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ AlistAppAdd()
fi

echo
inquirer text_input "输入 Alist 名称" alist_name "$i18n_not_set"
inquirer text_input "输入 Alist 名称" alist_name "$i18n_blank"

if [ "$alist_name" == "$i18n_not_set" ]
if [ "$alist_name" == "$i18n_blank" ]
then
alist_name=""
fi
Expand Down
4 changes: 2 additions & 2 deletions src/arm
Original file line number Diff line number Diff line change
Expand Up @@ -823,8 +823,8 @@ EOF
fi

echo
inquirer text_input "输入当前配置保存名称: " config_name "$i18n_not_set"
if [ "$config_name" == "$i18n_not_set" ]
inquirer text_input "输入当前配置保存名称: " config_name "$i18n_blank"
if [ "$config_name" == "$i18n_blank" ]
then
config_name=""
else
Expand Down
8 changes: 6 additions & 2 deletions src/calibre/install
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,22 @@ CalibreInstall()
DepInstall libglvnd-opengl
DepInstall libxcb-cursor-devel
DepInstall nss
DepInstall libxkbcommon
DepInstall mesa-libEGL
else
DepInstall xz-utils
DepInstall libopengl0
DepInstall libxcb-cursor0
DepInstall libnss3
DepInstall libxkbcommon-x11-0
DepInstall libglx0
DepInstall libegl1
fi
ImageMagickInstall
DepInstall libegl1
PythonInstall
pip3 install pyqt6
mkdir -p "$CALIBRE_ROOT"/bin
sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin install_dir="$CALIBRE_ROOT"/bin
sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin install_dir="$CALIBRE_ROOT"/bin version=7.16.0
fi

Println "$info calibre 安装/更新成功\n"
Expand Down
16 changes: 8 additions & 8 deletions src/calibre/kcc
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ KccConfig()
else
kcc_process=true
echo
inquirer text_input "输入额外参数" kcc_args "$i18n_not_set"
if [ "$kcc_args" == "$i18n_not_set" ]
inquirer text_input "输入额外参数" kcc_args "$i18n_blank"
if [ "$kcc_args" == "$i18n_blank" ]
then
kcc_args=""
fi
Expand Down Expand Up @@ -185,8 +185,8 @@ KccConfigEdit()
;;
2)
echo
inquirer text_input "输入额外参数" new_kcc_args "$i18n_not_set"
if [ "$new_kcc_args" == "$i18n_not_set" ]
inquirer text_input "输入额外参数" new_kcc_args "$i18n_blank"
if [ "$new_kcc_args" == "$i18n_blank" ]
then
new_kcc_args=""
fi
Expand All @@ -212,8 +212,8 @@ KccConfigEdit()
while true
do
echo
inquirer text_input "输入源图片目录" new_kcc_source "$i18n_not_set"
if [ "$new_kcc_source" == "$i18n_not_set" ]
inquirer text_input "输入源图片目录" new_kcc_source "$i18n_blank"
if [ "$new_kcc_source" == "$i18n_blank" ]
then
break
fi
Expand Down Expand Up @@ -256,8 +256,8 @@ KccConfigEdit()
while true
do
echo
inquirer text_input "修改源图片目录 ${kcc_sources[kcc_sources_index]}" new_kcc_source "$i18n_not_set"
if [ "$new_kcc_source" == "$i18n_not_set" ]
inquirer text_input "修改源图片目录 ${kcc_sources[kcc_sources_index]}" new_kcc_source "$i18n_blank"
if [ "$new_kcc_source" == "$i18n_blank" ]
then
continue 2
fi
Expand Down
2 changes: 2 additions & 0 deletions src/calibre/web
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ CalibreWebInstall()
if [ -d "$CALIBRE_ROOT/web" ]
then
cd "$CALIBRE_ROOT/web"
git stash
git pull
git stash pop
Println "$info Calibre Web 更新成功\n"
return
fi
Expand Down
4 changes: 2 additions & 2 deletions src/cloudflare/config_route
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ CloudflareConfigWorkerRoute()
then
cf_workers_index=$((script-1))
echo
inquirer list_input_index "是想要输入 ${cf_workers_project_name[cf_workers_index]}" yn_options yn_options_index
inquirer list_input_index "是想要输入 ${cf_workers_project_name[cf_workers_index]}" yn_options yn_index

if [ "$yn_options_index" -eq 0 ]
if [ "$yn_index" -eq 0 ]
then
script=${cf_workers_project_name[cf_workers_index]}
fi
Expand Down
8 changes: 4 additions & 4 deletions src/cloudflare/edit_user
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ CloudflareEditUser()
Println " 用户密码: ${green} $cf_user_pass_new ${normal}\n"

Println "请输入用户 Token"
read -p "(默认: ${cf_user_token:-$i18n_not_set}): " cf_user_token_new
read -p "(默认: ${cf_user_token:-$i18n_blank}): " cf_user_token_new
cf_user_token_new=${cf_user_token_new:-$cf_user_token}
Println " 用户 Token: ${green} ${cf_user_token_new:-$i18n_not_set} ${normal}\n"
Println " 用户 Token: ${green} ${cf_user_token_new:-$i18n_blank} ${normal}\n"

Println "请输入用户 Key"
read -p "(默认: ${cf_user_api_key:-$i18n_not_set}): " cf_user_api_key_new
read -p "(默认: ${cf_user_api_key:-$i18n_blank}): " cf_user_api_key_new
cf_user_api_key_new=${cf_user_api_key_new:-$cf_user_api_key}
Println " 用户 Token: ${green} ${cf_user_api_key_new:-$i18n_not_set} ${normal}\n"
Println " 用户 Token: ${green} ${cf_user_api_key_new:-$i18n_blank} ${normal}\n"

new_user=$(
$JQ_FILE -n --arg email "$cf_user_email_new" --arg pass "$cf_user_pass_new" \
Expand Down
4 changes: 2 additions & 2 deletions src/cloudflare/edit_worker
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ CloudflareEditWorker()
if [ -d "$CF_WORKERS_ROOT/${cf_workers_path[cf_workers_index]:-notfound}" ]
then
echo
inquirer list_input_index "是否删除原路径目录" yn_options yn_options_index
inquirer list_input_index "是否删除原路径目录" yn_options yn_index

if [ "$yn_options_index" -eq 0 ]
if [ "$yn_index" -eq 0 ]
then
rm -rf "$CF_WORKERS_ROOT/${cf_workers_path[cf_workers_index]:-notfound}"
fi
Expand Down
8 changes: 4 additions & 4 deletions src/cloudflare/set_user
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ CloudflareSetUserPass()
CloudflareSetUserToken()
{
Println "$tip 需要 workers 和 zone(区域) 编辑权限, 以及 zone(区域) 的 Analytics 读取权限"
inquirer text_input "请输入用户 Token: " cf_user_token "$i18n_not_set"
if [ "$cf_user_token" == "$i18n_not_set" ]
inquirer text_input "请输入用户 Token: " cf_user_token "$i18n_blank"
if [ "$cf_user_token" == "$i18n_blank" ]
then
cf_user_token=""
else
Expand All @@ -51,8 +51,8 @@ CloudflareSetUserToken()
CloudflareSetUserKey()
{
echo
inquirer text_input "请输入用户 Global API KEY: " cf_user_api_key "$i18n_not_set"
if [ "$cf_user_api_key" == "$i18n_not_set" ]
inquirer text_input "请输入用户 Global API KEY: " cf_user_api_key "$i18n_blank"
if [ "$cf_user_api_key" == "$i18n_blank" ]
then
cf_user_api_key=""
fi
Expand Down
4 changes: 2 additions & 2 deletions src/cx
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ case $xtream_codes_num in
echo -e "$result" >> "$XTREAM_CODES_EXAM"

echo && echo
inquirer list_input_index "验证 mac" ny_options ny_options_index
inquirer list_input_index "验证 mac" ny_options ny_index

if [ "$ny_options_index" -eq 1 ]
if [ "$ny_index" -eq 1 ]
then
verify_mac=1
fi
Expand Down
1 change: 0 additions & 1 deletion src/haproxy/install
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ HAProxyInstall()
fi

cd haproxy-"${haproxy_ver}"
make clean

if [ "$dist" == "mac" ]
then
Expand Down
4 changes: 2 additions & 2 deletions src/ibm_cf/set_app
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ IbmSetCfAppRouteHostname()
IbmSetCfAppRoutePath()
{
echo
inquirer text_input "请输入 http 路由 path: " ibm_cf_app_route_path "$i18n_not_set"
if [ "$ibm_cf_app_route_path" == "$i18n_not_set" ]
inquirer text_input "请输入 http 路由 path: " ibm_cf_app_route_path "$i18n_blank"
if [ "$ibm_cf_app_route_path" == "$i18n_blank" ]
then
ibm_cf_app_route_path=""
fi
Expand Down
Loading

0 comments on commit bad65c9

Please sign in to comment.