update 2026-07-12 04:41:30

This commit is contained in:
action committed 2026-07-12 04:41:30 +08:00
1 parent 638ee2bb02
commit 9ae41ca390
8 files changed
+1036 -994

No files matched your search

@@ -723,6 +723,14 @@ if (!isEmpty(main_node)) {
outbound: 'main-udp-out'
});
/* Proxy list */
if (length(proxy_domain_list))
push(config.route.rules, {
rule_set: 'proxy-domain',
action: 'route',
outbound: 'main-out'
});
config.route.final = 'main-out';
/* Rule set */
@@ -19,10 +19,6 @@ log() {
printf '%s %s\n' "$(date "+%Y-%m-%d %H:%M:%S")" "$*" >> "$LOG_PATH"
}
to_upper() {
printf '%s\n' "$1" | tr '[:lower:]' '[:upper:]'
}
download() {
local source_file="$1"
local target_file="$2"
@@ -55,10 +51,10 @@ CURRENT=1
for RESOURCE in china_ip4 china_ip6 china_list gfw_list; do
OLD_VER="$(cat "$RESOURCES_DIR/$RESOURCE.ver" 2>/dev/null || echo "NOT FOUND")"
if [ "$OLD_VER" = "$NEW_VER" ]; then
log "[$(to_upper "$RESOURCE")] Current version: $NEW_VER."
log "[$RESOURCE] Current version: $NEW_VER."
else
CURRENT=0
log "[$(to_upper "$RESOURCE")] Local version: $OLD_VER, latest version: $NEW_VER."
log "[$RESOURCE] Local version: $OLD_VER, latest version: $NEW_VER."
fi
done
[ "$CURRENT" -eq 0 ] || {
@@ -88,7 +84,7 @@ fi
for RESOURCE in china_ip4 china_ip6 china_list gfw_list; do
if [ ! -s "$TMP_DIR/$RESOURCE.txt" ] || grep -qi '<html' "$TMP_DIR/$RESOURCE.txt"; then
log "[$(to_upper "$RESOURCE")] Update failed: invalid processed list."
log "[$RESOURCE] Update failed: invalid processed list."
exit 1
fi
printf '%s\n' "$NEW_VER" > "$TMP_DIR/$RESOURCE.ver" || exit 1
@@ -97,10 +93,10 @@ done
for RESOURCE in china_ip4 china_ip6 china_list gfw_list; do
if ! mv -f "$TMP_DIR/$RESOURCE.txt" "$RESOURCES_DIR/$RESOURCE.txt" || \
! mv -f "$TMP_DIR/$RESOURCE.ver" "$RESOURCES_DIR/$RESOURCE.ver"; then
log "[$(to_upper "$RESOURCE")] Update failed: unable to replace list."
log "[$RESOURCE] Update failed: unable to replace list."
exit 1
fi
log "[$(to_upper "$RESOURCE")] Successfully updated."
log "[$RESOURCE] Successfully updated."
done
exit 0
+9 -3
View File
@@ -179,11 +179,17 @@ start_service() {
esac
if [ "$routing_mode" != "custom" ] && [ -s "$HP_DIR/resources/proxy_list.txt" ]; then
local wan_nftset_v6
[ "$ipv6_support" -eq "0" ] || wan_nftset_v6=",6#inet#fw4#homeproxy_wan_proxy_addr_v6"
sed -r -e '/^\s*$/d' -e "s/(.*)/server=\/\1\/127.0.0.1#$dns_port\nnftset=\/\1\\/4#inet#fw4#homeproxy_wan_proxy_addr_v4$wan_nftset_v6/g" \
local proxy_nftset_v6
[ "$ipv6_support" -eq "0" ] || proxy_nftset_v6=",6#inet#fw4#homeproxy_wan_proxy_addr_v6"
sed -r -e '/^\s*$/d' -e "s/(.*)/server=\/\1\/127.0.0.1#$dns_port\nnftset=\/\1\\/4#inet#fw4#homeproxy_wan_proxy_addr_v4$proxy_nftset_v6/g" \
"$HP_DIR/resources/proxy_list.txt" > "$DNSMASQ_DIR/proxy_list.conf"
fi
if [ "$routing_mode" != "custom" ] && [ -s "$HP_DIR/resources/direct_list.txt" ]; then
local direct_nftset_v6
[ "$ipv6_support" -eq "0" ] || direct_nftset_v6=",6#inet#fw4#homeproxy_wan_direct_addr_v6"
sed -r -e '/^\s*$/d' -e "s/(.*)/server=\/\1\/127.0.0.1#$dns_port\nnftset=\/\1\\/4#inet#fw4#homeproxy_wan_direct_addr_v4$direct_nftset_v6/g" \
"$HP_DIR/resources/direct_list.txt" > "$DNSMASQ_DIR/direct_list.conf"
fi
/etc/init.d/dnsmasq restart >"/dev/null" 2>&1
# Setup routing table