Skip to content

Commit 047bf2b

Browse files
committed
fix ping host ip type
1 parent d6ec52c commit 047bf2b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/core.sh

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

xray.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

33
args=$@
4-
is_sh_ver=v1.12
4+
is_sh_ver=v1.13
55

66
. /etc/xray/sh/src/init.sh

0 commit comments

Comments
 (0)