fix ping host ip type

This commit is contained in:
233boy
2023-07-12 20:38:19 +08:00
parent 5c6f48df83
commit 67387eb0a1
2 changed files with 4 additions and 2 deletions

View File

@@ -1383,7 +1383,9 @@ get() {
[[ $? != 0 ]] && err "无法生成 Shadowsocks 2022 密码, 请安装 openssl." [[ $? != 0 ]] && err "无法生成 Shadowsocks 2022 密码, 请安装 openssl."
;; ;;
ping) ping)
is_host_dns=$(ping $host -c 1 -W 2 | head -1) is_ip_type="-4"
[[ $(grep ":" <<<$ip) ]] && is_ip_type="-6"
is_host_dns=$(ping $host $is_ip_type -c 1 -W 2 | head -1)
;; ;;
log | logerr) log | logerr)
msg "\n 提醒: 按 $(_green Ctrl + C) 退出\n" msg "\n 提醒: 按 $(_green Ctrl + C) 退出\n"

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
args=$@ args=$@
is_sh_ver=v4.11 is_sh_ver=v4.12
. /etc/v2ray/sh/src/init.sh . /etc/v2ray/sh/src/init.sh