diff --git a/linkease/nas/floatip/Makefile b/linkease/nas/floatip/Makefile index 86f54d88..d59bb269 100644 --- a/linkease/nas/floatip/Makefile +++ b/linkease/nas/floatip/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=floatip -PKG_VERSION:=1.0.6 +PKG_VERSION:=1.0.8 PKG_RELEASE:=1 PKG_MAINTAINER:=jjm2473 diff --git a/linkease/nas/floatip/files/floatip.sh b/linkease/nas/floatip/files/floatip.sh index eff5989e..bf50583b 100755 --- a/linkease/nas/floatip/files/floatip.sh +++ b/linkease/nas/floatip/files/floatip.sh @@ -64,19 +64,25 @@ set_lan_ping() { /etc/init.d/firewall reload 2>&1 } +safe_sleep() { + local sec="$1" + [[ "$sec" -lt 1 ]] && sec=1 + sleep $sec +} + . /lib/functions.sh fallback_loop() { local set_ip check_ip set_net set_prefix config_get set_ip "main" set_ip - config_get check_ip "main" check_ip - [[ "$set_ip" = "*/*" ]] || set_ip="$set_ip/32" + [[ -n "$set_ip" ]] || return 1 + [[ "$set_ip" = "*/*" ]] || set_ip="$set_ip/$DEFAULT_PREFIX" eval "$(ipcalc.sh "$set_ip" )";set_net=$NETWORK;set_prefix=$PREFIX;set_ip=$IP - [[ "$set_net" = 0.0.0.0 ]] && set_net=192.168.100.0 - [[ "$set_prefix" = 32 ]] && set_prefix=$DEFAULT_PREFIX - [[ "$set_ip" = 0.0.0.0 ]] && set_ip=192.168.100.3 local ipaddr="$set_ip/$set_prefix" + echo "ipaddr=$ipaddr" + local valid_check_ip cip + config_get check_ip "main" check_ip for cip in $check_ip; do eval "$(ipcalc.sh $cip/$set_prefix )" [[ "$NETWORK" = "$set_net" ]] && valid_check_ip="$valid_check_ip $cip" @@ -108,16 +114,16 @@ fallback_loop() { else dead_counter=0 fi - [[ $consume_time -lt 10 ]] && sleep $((10 - $consume_time)) + safe_sleep $((10 - $consume_time)) continue fi if [[ $floatip_up = 1 ]]; then - [[ $consume_time -lt 5 ]] && sleep $((5 - $consume_time)) + safe_sleep $((5 - $consume_time)) continue fi dead_counter=$(($dead_counter + 1)) if [[ $dead_counter -lt 3 ]]; then - [[ $consume_time -lt 10 ]] && sleep $((10 - $consume_time)) + safe_sleep $((10 - $consume_time)) continue fi echo "no host alive, set up floatip $ipaddr" >&2 @@ -128,14 +134,13 @@ fallback_loop() { } main_loop() { - local set_ip set_net set_prefix + local set_ip set_prefix config_get set_ip "main" set_ip - [[ "$set_ip" = "*/*" ]] || set_ip="$set_ip/32" - eval "$(ipcalc.sh "$set_ip" )";set_net=$NETWORK;set_prefix=$PREFIX;set_ip=$IP - [[ "$set_net" = 0.0.0.0 ]] && set_net=192.168.100.0 - [[ "$set_prefix" = 32 ]] && set_prefix=$DEFAULT_PREFIX - [[ "$set_ip" = 0.0.0.0 ]] && set_ip=192.168.100.3 + [[ -n "$set_ip" ]] || return 1 + [[ "$set_ip" = "*/*" ]] || set_ip="$set_ip/$DEFAULT_PREFIX" + eval "$(ipcalc.sh "$set_ip" )";set_prefix=$PREFIX;set_ip=$IP local ipaddr="$set_ip/$set_prefix" + echo "ipaddr=$ipaddr" local check_urls check_url_timeout config_get check_urls "main" check_url @@ -177,14 +182,16 @@ main_loop() { set_up "$ipaddr" floatip_up=1 fi + else + set_lan_ping 0 fi - [[ $consume_time -lt 5 ]] && sleep $((5 - $consume_time)) + safe_sleep $((5 - $consume_time)) continue else if [[ $url_pass = 0 ]]; then dead_counter=$(($dead_counter + 1)) if [[ $dead_counter -lt 3 ]]; then - [[ $consume_time -lt 5 ]] && sleep $((5 - $consume_time)) + safe_sleep $((5 - $consume_time)) continue fi echo "set down floatip, and disable ping" >&2 diff --git a/luci-app-passwall/luasrc/controller/passwall.lua b/luci-app-passwall/luasrc/controller/passwall.lua index 58c7d1a0..ce89a374 100644 --- a/luci-app-passwall/luasrc/controller/passwall.lua +++ b/luci-app-passwall/luasrc/controller/passwall.lua @@ -217,11 +217,11 @@ function index_status() if dns_shunt == "smartdns" then e.dns_mode_status = luci.sys.call("pidof smartdns >/dev/null") == 0 elseif dns_shunt == "chinadns-ng" then - local port = string.match(luci.sys.exec("cat /tmp/etc/passwall/acl/default/chinadns_ng.conf"), "bind%-port%s*(%d+)") or "65353" - e.dns_mode_status = luci.sys.call(string.format("netstat -apn | grep ':%s ' >/dev/null", port)) == 0 + e.dns_mode_status = luci.sys.call("/bin/busybox top -bn1 | grep -v 'grep' | grep '/tmp/etc/passwall/bin/' | grep 'default' | grep 'chinadns_ng' >/dev/null") == 0 else e.dns_mode_status = luci.sys.call("netstat -apn | grep ':15353 ' >/dev/null") == 0 end + e.haproxy_status = luci.sys.call(string.format("/bin/busybox top -bn1 | grep -v grep | grep '%s/bin/' | grep haproxy >/dev/null", appname)) == 0 e["tcp_node_status"] = luci.sys.call("/bin/busybox top -bn1 | grep -v 'grep' | grep '/tmp/etc/passwall/bin/' | grep 'default' | grep 'TCP' >/dev/null") == 0 diff --git a/pdnsd-alt/Makefile b/pdnsd-alt/Makefile index 3a66f76b..41dd874f 100644 --- a/pdnsd-alt/Makefile +++ b/pdnsd-alt/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pdnsd -PKG_VERSION:=1.2.9b-par +PKG_VERSION:=1.2.9b_pre PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git diff --git a/v2ray-geoview/Makefile b/v2ray-geoview/Makefile index 5bde4bce..a8f999a9 100644 --- a/v2ray-geoview/Makefile +++ b/v2ray-geoview/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=geoview -PKG_VERSION:=0.0.9 +PKG_VERSION:=0.1.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/snowie2000/geoview/tar.gz/$(PKG_VERSION)? -PKG_HASH:=ba0af14cd7a6ce457584ab4754331848ed78240ae39abdf65fef646df0130c2e +PKG_HASH:=f957ccda8177657ce386c2a823cdf0d2746a0c03ce2e1a767cf9da12dccc476b PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE