luci-app-ssr-plus: speedup restart when server-node disable ping

This commit is contained in:
coolsnowwolf 2020-02-26 16:46:34 +08:00
parent c6b967d815
commit 0f4afd6233
2 changed files with 4 additions and 4 deletions

View File

@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-ssr-plus
PKG_VERSION:=152
PKG_RELEASE:=2
PKG_VERSION:=153
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

View File

@ -64,7 +64,7 @@ gen_config_file() {
elif [ "$host" != "${host#*:[0-9a-fA-F]}" ]; then
hostip=$host
else
hostip=$(ping $host -s 1 -c 1 | grep PING | cut -d'(' -f 2 | cut -d')' -f1)
hostip=$(ping $host -W 1 -s 1 -c 1 | grep PING | cut -d'(' -f 2 | cut -d')' -f1)
if echo $hostip | grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$" >/dev/null; then
hostip=$hostip
else
@ -148,7 +148,7 @@ start_rules() {
elif [ "$server" != "${server#*:[0-9a-fA-F]}" ]; then
server=$server
else
server=$(ping $server -s 1 -c 1 | grep PING | cut -d'(' -f 2 | cut -d')' -f1)
server=$(ping $server -W 1 -s 1 -c 1 | grep PING | cut -d'(' -f 2 | cut -d')' -f1)
if echo $server | grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$" >/dev/null; then
echo $server >/etc/ssr_ip
else