🔥 Sync 2024-12-10 00:34

This commit is contained in:
github-actions[bot] 2024-12-10 00:34:37 +08:00
parent 8482aa18be
commit a9150d2067
5 changed files with 29 additions and 22 deletions

View File

@ -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 <jjm2473@gmail.com>

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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