mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-08 20:46:50 +03:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ada807fec3 | ||
|
|
b28a5f1293 | ||
|
|
2332eae5ff | ||
|
|
a755b6661d | ||
|
|
567ce52253 | ||
|
|
b736360b66 |
@@ -74,8 +74,8 @@ Luci: Services/podkop
|
|||||||
**Custom subnets enable** - Добавить подсети или IP-адреса. Для подсетей задать маску.
|
**Custom subnets enable** - Добавить подсети или IP-адреса. Для подсетей задать маску.
|
||||||
|
|
||||||
# Известные баги
|
# Известные баги
|
||||||
- [ ] Не отрабатывает service podkop stop, если podkop запущен и не может, к пример, зарезолвить домен с сломанным DNS
|
- [x] Не отрабатывает service podkop stop, если podkop запущен и не может, к пример, зарезолвить домен с сломанным DNS
|
||||||
- [ ] Update list из remote url domain не удаляет старые домены. А добавляет новые. Для подсетей тоже самое скорее всего. Пересоздавать ruleset?
|
- [x] Update list из remote url domain не удаляет старые домены. А добавляет новые. Для подсетей тоже самое скорее всего. Пересоздавать ruleset?
|
||||||
|
|
||||||
# ToDo
|
# ToDo
|
||||||
Этот раздел не означает задачи, которые нужно брать и делать. Это общий список хотелок. Если вы хотите помочь, пожалуйста, спросите сначала в телеграмме.
|
Этот раздел не означает задачи, которые нужно брать и делать. Это общий список хотелок. Если вы хотите помочь, пожалуйста, спросите сначала в телеграмме.
|
||||||
@@ -84,6 +84,8 @@ Luci: Services/podkop
|
|||||||
- [ ] Диагностика: Proxy check completed successfully предположительно не показывает IP, если вернулся это IPv6.
|
- [ ] Диагностика: Proxy check completed successfully предположительно не показывает IP, если вернулся это IPv6.
|
||||||
- [ ] Сделать галку запрещающую подкопу редачить dhcp. Допилить в исключение вместе с пустыми полями proxy и vpn
|
- [ ] Сделать галку запрещающую подкопу редачить dhcp. Допилить в исключение вместе с пустыми полями proxy и vpn
|
||||||
- [ ] Обработка ошибки `sing-box[9345]: FATAL[0000] start service: initialize DNS rule[2]: rule-set not found: main`. Когда не задана строка\интерфейс
|
- [ ] Обработка ошибки `sing-box[9345]: FATAL[0000] start service: initialize DNS rule[2]: rule-set not found: main`. Когда не задана строка\интерфейс
|
||||||
|
- [ ] Проверка `/etc/resolv.conf` на наличие DNS-серверов
|
||||||
|
- [ ] Отслеживание интерфейса wan в sing-box
|
||||||
|
|
||||||
Низкий приоритет
|
Низкий приоритет
|
||||||
- [ ] Галочка, которая режет доступ к doh серверам
|
- [ ] Галочка, которая режет доступ к doh серверам
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=luci-app-podkop
|
PKG_NAME:=luci-app-podkop
|
||||||
PKG_VERSION:=0.3.23
|
PKG_VERSION:=0.3.24
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
LUCI_TITLE:=LuCI podkop app
|
LUCI_TITLE:=LuCI podkop app
|
||||||
|
|||||||
@@ -827,7 +827,7 @@ return view.extend({
|
|||||||
o.value('dns.adguard-dns.com', 'AdGuard Default (dns.adguard-dns.com)');
|
o.value('dns.adguard-dns.com', 'AdGuard Default (dns.adguard-dns.com)');
|
||||||
o.value('unfiltered.adguard-dns.com', 'AdGuard Unfiltered (unfiltered.adguard-dns.com)');
|
o.value('unfiltered.adguard-dns.com', 'AdGuard Unfiltered (unfiltered.adguard-dns.com)');
|
||||||
o.value('family.adguard-dns.com', 'AdGuard Family (family.adguard-dns.com)');
|
o.value('family.adguard-dns.com', 'AdGuard Family (family.adguard-dns.com)');
|
||||||
o.default = '1.1.1.1';
|
o.default = '8.8.8.8';
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
o.ucisection = 'main';
|
o.ucisection = 'main';
|
||||||
o.validate = function (section_id, value) {
|
o.validate = function (section_id, value) {
|
||||||
@@ -856,7 +856,7 @@ return view.extend({
|
|||||||
};
|
};
|
||||||
|
|
||||||
o = mainSection.taboption('additional', form.Value, 'dns_rewrite_ttl', _('DNS Rewrite TTL'), _('Time in seconds for DNS record caching (default: 600)'));
|
o = mainSection.taboption('additional', form.Value, 'dns_rewrite_ttl', _('DNS Rewrite TTL'), _('Time in seconds for DNS record caching (default: 600)'));
|
||||||
o.default = '600';
|
o.default = '60';
|
||||||
o.rmempty = false;
|
o.rmempty = false;
|
||||||
o.ucisection = 'main';
|
o.ucisection = 'main';
|
||||||
o.validate = function (section_id, value) {
|
o.validate = function (section_id, value) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=podkop
|
PKG_NAME:=podkop
|
||||||
PKG_VERSION:=0.3.23
|
PKG_VERSION:=0.3.24
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_MAINTAINER:=ITDog <podkop@itdog.info>
|
PKG_MAINTAINER:=ITDog <podkop@itdog.info>
|
||||||
|
|||||||
@@ -32,6 +32,6 @@ config main 'main'
|
|||||||
option dont_touch_dhcp '0'
|
option dont_touch_dhcp '0'
|
||||||
option update_interval '1d'
|
option update_interval '1d'
|
||||||
option dns_type 'doh'
|
option dns_type 'doh'
|
||||||
option dns_server '1.1.1.1'
|
option dns_server '8.8.8.8'
|
||||||
option dns_rewrite_ttl '600'
|
option dns_rewrite_ttl '60'
|
||||||
option cache_file '/tmp/cache.db'
|
option cache_file '/tmp/cache.db'
|
||||||
@@ -68,15 +68,17 @@ start() {
|
|||||||
# sing-box outbounds and rules
|
# sing-box outbounds and rules
|
||||||
config_foreach sing_box_outdound
|
config_foreach sing_box_outdound
|
||||||
config_foreach process_domains_for_section
|
config_foreach process_domains_for_section
|
||||||
config_foreach process_remote_ruleset
|
|
||||||
config_foreach sing_box_rule_preset
|
config_foreach sing_box_rule_preset
|
||||||
config_foreach process_domains_list_local
|
config_foreach process_domains_list_local
|
||||||
config_foreach process_domains_list_url
|
|
||||||
config_foreach process_subnet_for_section
|
config_foreach process_subnet_for_section
|
||||||
config_foreach process_subnet_for_section_remote
|
config_foreach process_remote_ruleset_srs
|
||||||
config_foreach process_all_traffic_for_section
|
config_foreach process_all_traffic_for_section
|
||||||
config_foreach add_cron_job
|
config_foreach add_cron_job
|
||||||
|
|
||||||
|
config_foreach prepare_custom_ruleset
|
||||||
|
list_update &
|
||||||
|
echo $! > /var/run/podkop_list_update.pid
|
||||||
|
|
||||||
# Future: exclude at the fakeip?
|
# Future: exclude at the fakeip?
|
||||||
config_get_bool exclude_from_ip_enabled "main" "exclude_from_ip_enabled" "0"
|
config_get_bool exclude_from_ip_enabled "main" "exclude_from_ip_enabled" "0"
|
||||||
if [ "$exclude_from_ip_enabled" -eq 1 ]; then
|
if [ "$exclude_from_ip_enabled" -eq 1 ]; then
|
||||||
@@ -123,6 +125,16 @@ start() {
|
|||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
log "Stopping the podkop"
|
log "Stopping the podkop"
|
||||||
|
|
||||||
|
if [ -f /var/run/podkop_list_update.pid ]; then
|
||||||
|
pid=$(cat /var/run/podkop_list_update.pid)
|
||||||
|
if kill -0 "$pid"; then
|
||||||
|
kill "$pid"
|
||||||
|
log "Stopped list_update"
|
||||||
|
fi
|
||||||
|
rm -f /var/run/podkop_list_update.pid
|
||||||
|
fi
|
||||||
|
|
||||||
remove_cron_job
|
remove_cron_job
|
||||||
|
|
||||||
config_get_bool dont_touch_dhcp "main" "dont_touch_dhcp" "0"
|
config_get_bool dont_touch_dhcp "main" "dont_touch_dhcp" "0"
|
||||||
@@ -202,6 +214,9 @@ migration() {
|
|||||||
log "Found and removed use-application-dns.net in dhcp config"
|
log "Found and removed use-application-dns.net in dhcp config"
|
||||||
sed -i '/use-application-dns/d' "/etc/config/dhcp"
|
sed -i '/use-application-dns/d' "/etc/config/dhcp"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# corntab init.d
|
||||||
|
(crontab -l | grep -v "/etc/init.d/podkop list_update") | crontab -
|
||||||
}
|
}
|
||||||
|
|
||||||
validate_service() {
|
validate_service() {
|
||||||
@@ -389,19 +404,19 @@ add_cron_job() {
|
|||||||
|
|
||||||
case "$update_interval" in
|
case "$update_interval" in
|
||||||
"1h")
|
"1h")
|
||||||
cron_job="13 * * * * /etc/init.d/podkop list_update"
|
cron_job="13 * * * * /usr/bin/podkop list_update"
|
||||||
;;
|
;;
|
||||||
"3h")
|
"3h")
|
||||||
cron_job="13 */3 * * * /etc/init.d/podkop list_update"
|
cron_job="13 */3 * * * /usr/bin/podkop list_update"
|
||||||
;;
|
;;
|
||||||
"12h")
|
"12h")
|
||||||
cron_job="13 */12 * * * /etc/init.d/podkop list_update"
|
cron_job="13 */12 * * * /usr/bin/podkop list_update"
|
||||||
;;
|
;;
|
||||||
"1d")
|
"1d")
|
||||||
cron_job="13 9 * * * /etc/init.d/podkop list_update"
|
cron_job="13 9 * * * /usr/bin/podkop list_update"
|
||||||
;;
|
;;
|
||||||
"3d")
|
"3d")
|
||||||
cron_job="13 9 */3 * * /etc/init.d/podkop list_update"
|
cron_job="13 9 */3 * * /usr/bin/podkop list_update"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
log "Invalid update_interval value: $update_interval"
|
log "Invalid update_interval value: $update_interval"
|
||||||
@@ -421,13 +436,73 @@ add_cron_job() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
remove_cron_job() {
|
remove_cron_job() {
|
||||||
(crontab -l | grep -v "/etc/init.d/podkop list_update") | crontab -
|
(crontab -l | grep -v "/usr/bin/podkop list_update") | crontab -
|
||||||
log "The cron job removed"
|
log "The cron job removed"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prepare_custom_ruleset() {
|
||||||
|
config_get custom_download_domains_list_enabled "$section" "custom_download_domains_list_enabled"
|
||||||
|
config_get custom_download_domains_list_enabled "$section" "custom_download_subnets_list_enabled"
|
||||||
|
if [ "$custom_download_domains_list_enabled" -eq 1 ] || [ "$custom_download_subnets_list_enabled" -eq 1 ]; then
|
||||||
|
local file="/tmp/podkop/$section-custom-domains-subnets.json"
|
||||||
|
local tag="custom-$section"
|
||||||
|
rm -f $file
|
||||||
|
jq -n '
|
||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"rules": []
|
||||||
|
}' > $file
|
||||||
|
|
||||||
|
jq --arg tag "$tag" \
|
||||||
|
--arg file "$file" \
|
||||||
|
'.route.rule_set += [{
|
||||||
|
"tag": $tag,
|
||||||
|
"type": "local",
|
||||||
|
"format": "source",
|
||||||
|
"path": $file
|
||||||
|
}]' $SING_BOX_CONFIG >/tmp/sing-box-config-tmp.json && mv /tmp/sing-box-config-tmp.json $SING_BOX_CONFIG
|
||||||
|
|
||||||
|
sing_box_rules $tag $section
|
||||||
|
sing_box_dns_rule_fakeip_section $tag $tag
|
||||||
|
|
||||||
|
log "Added 'test' rule_set to sing-box config"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
list_update() {
|
list_update() {
|
||||||
log "Update remote lists"
|
log "Update remote lists"
|
||||||
config_foreach process_remote_ruleset
|
|
||||||
|
local i
|
||||||
|
|
||||||
|
for i in $(seq 1 60); do
|
||||||
|
if nslookup -timeout=1 openwrt.org >/dev/null 2>&1; then
|
||||||
|
log "DNS is available"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
log "DNS is unavailable [$i/60]"
|
||||||
|
sleep 3
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$i" -eq 60 ]; then
|
||||||
|
log "Error: DNS check failed after 10 attempts"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
for i in $(seq 1 60); do
|
||||||
|
if curl -s -m 3 https://github.com >/dev/null; then
|
||||||
|
log "GitHub is available"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
log "GitHub is unavailable [$i/60]"
|
||||||
|
sleep 3
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "$i" -eq 60 ]; then
|
||||||
|
log "Error: Cannot connect to GitHub after 10 attempts"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
config_foreach process_remote_ruleset_subnet
|
||||||
config_foreach process_domains_list_url
|
config_foreach process_domains_list_url
|
||||||
config_foreach process_subnet_for_section_remote
|
config_foreach process_subnet_for_section_remote
|
||||||
}
|
}
|
||||||
@@ -459,30 +534,45 @@ sing_box_uci() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Future: for every section. +1 port?
|
add_socks5_for_section() {
|
||||||
|
local section="$1"
|
||||||
|
local port="$2"
|
||||||
|
local tag="$section-mixed-in"
|
||||||
|
|
||||||
|
log "Adding Socks5 for $section on port $port"
|
||||||
|
|
||||||
|
jq \
|
||||||
|
--arg tag "$tag" \
|
||||||
|
--arg port "$port" \
|
||||||
|
--arg section "$section" \
|
||||||
|
'.inbounds += [{
|
||||||
|
"tag": $tag,
|
||||||
|
"type": "mixed",
|
||||||
|
"listen": "0.0.0.0",
|
||||||
|
"listen_port": ($port|tonumber),
|
||||||
|
"set_system_proxy": false
|
||||||
|
}] |
|
||||||
|
.route.rules += [{
|
||||||
|
"inbound": [$tag],
|
||||||
|
"outbound": $section,
|
||||||
|
"action": "route"
|
||||||
|
}]' $SING_BOX_CONFIG >/tmp/sing-box-config-tmp.json && mv /tmp/sing-box-config-tmp.json $SING_BOX_CONFIG
|
||||||
|
}
|
||||||
|
|
||||||
process_socks5() {
|
process_socks5() {
|
||||||
config_get_bool socks5 "main" "socks5" "0"
|
config_get_bool main_socks5 "main" "socks5" "0"
|
||||||
if [ "$socks5" -eq 1 ]; then
|
if [ "$main_socks5" -eq 1 ]; then
|
||||||
log "Socks5 local enable port 2080"
|
add_socks5_for_section "main" "2080"
|
||||||
jq '.inbounds += [{
|
|
||||||
"tag": "mixed-in",
|
|
||||||
"type": "mixed",
|
|
||||||
"listen": "0.0.0.0",
|
|
||||||
"listen_port": 2080,
|
|
||||||
"set_system_proxy": false
|
|
||||||
}]' $SING_BOX_CONFIG >/tmp/sing-box-config-tmp.json && mv /tmp/sing-box-config-tmp.json $SING_BOX_CONFIG
|
|
||||||
|
|
||||||
#local rule_exists=$(jq -r '.route.rules[] | select(.inbound[] == "mixed-in")' $SING_BOX_CONFIG)
|
|
||||||
local rule_exists=$(jq -r '.route.rules // [] | map(select(.inbound // [] | index("mixed-in"))) | length' $SING_BOX_CONFIG)
|
|
||||||
|
|
||||||
if [ -z "$rule_exists" ]; then
|
|
||||||
jq '.route.rules += [{
|
|
||||||
"inbound": ["mixed-in"],
|
|
||||||
"outbound": "main",
|
|
||||||
"action": "route"
|
|
||||||
}]' $SING_BOX_CONFIG >/tmp/sing-box-config-tmp.json && mv /tmp/sing-box-config-tmp.json $SING_BOX_CONFIG
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
local port=2081
|
||||||
|
for section in $(uci show podkop | awk -F'[.=]' '/=extra/ {print $2}'); do
|
||||||
|
config_get_bool section_socks5 "$section" "socks5" "0"
|
||||||
|
if [ "$section_socks5" -eq 1 ]; then
|
||||||
|
add_socks5_for_section "$section" "$port"
|
||||||
|
port=$((port + 1))
|
||||||
|
fi
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
sing_box_inbound_proxy() {
|
sing_box_inbound_proxy() {
|
||||||
@@ -1091,6 +1181,32 @@ sing_box_ruleset_subnets() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sing_box_ruleset_domains_json() {
|
||||||
|
local domain="$1"
|
||||||
|
local section="$2"
|
||||||
|
|
||||||
|
local file="/tmp/podkop/$section-custom-domains-subnets.json"
|
||||||
|
|
||||||
|
jq --arg domain "$domain" '
|
||||||
|
.rules[0].domain_suffix += if .rules[0].domain_suffix | index($domain) then [] else [$domain] end
|
||||||
|
' "$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
|
||||||
|
|
||||||
|
log "$domain added to custom-domains-subnets.json"
|
||||||
|
}
|
||||||
|
|
||||||
|
sing_box_ruleset_subnets_json() {
|
||||||
|
local subnet="$1"
|
||||||
|
local section="$2"
|
||||||
|
|
||||||
|
local file="/tmp/podkop/$section-custom-domains-subnets.json"
|
||||||
|
|
||||||
|
jq --arg subnet "$subnet" '
|
||||||
|
.rules[0].ip_cidr += if .rules[0].ip_cidr | index($subnet) then [] else [$subnet] end
|
||||||
|
' "$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
|
||||||
|
|
||||||
|
log "$subnet added to '$section'-custom-domains-subnets.json"
|
||||||
|
}
|
||||||
|
|
||||||
process_domains_for_section() {
|
process_domains_for_section() {
|
||||||
local section="$1"
|
local section="$1"
|
||||||
|
|
||||||
@@ -1227,11 +1343,18 @@ sing_box_quic_reject() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
process_remote_ruleset() {
|
process_remote_ruleset_srs() {
|
||||||
config_get_bool domain_list_enabled "$section" "domain_list_enabled" "0"
|
config_get_bool domain_list_enabled "$section" "domain_list_enabled" "0"
|
||||||
if [ "$domain_list_enabled" -eq 1 ]; then
|
if [ "$domain_list_enabled" -eq 1 ]; then
|
||||||
log "Adding a srs list for $section"
|
log "Adding a srs list for $section"
|
||||||
config_list_foreach "$section" domain_list "sing_box_ruleset_remote" "remote" "1d"
|
config_list_foreach "$section" domain_list "sing_box_ruleset_remote" "remote" "1d"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
process_remote_ruleset_subnet() {
|
||||||
|
config_get_bool domain_list_enabled "$section" "domain_list_enabled" "0"
|
||||||
|
if [ "$domain_list_enabled" -eq 1 ]; then
|
||||||
|
log "Adding a srs list for $section"
|
||||||
config_list_foreach "$section" domain_list "list_subnets_download" "$section" "$domain_list"
|
config_list_foreach "$section" domain_list "list_subnets_download" "$section" "$domain_list"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -1240,17 +1363,15 @@ sing_box_rule_preset() {
|
|||||||
config_get custom_domains_list_type "$section" "custom_domains_list_type"
|
config_get custom_domains_list_type "$section" "custom_domains_list_type"
|
||||||
config_get custom_subnets_list_enabled "$section" "custom_subnets_list_enabled"
|
config_get custom_subnets_list_enabled "$section" "custom_subnets_list_enabled"
|
||||||
config_get custom_local_domains_list_enabled "$section" "custom_local_domains_list_enabled"
|
config_get custom_local_domains_list_enabled "$section" "custom_local_domains_list_enabled"
|
||||||
config_get custom_download_domains_list_enabled "$section" "custom_download_domains_list_enabled"
|
# config_get custom_download_domains_list_enabled "$section" "custom_download_domains_list_enabled"
|
||||||
config_get custom_download_subnets_list_enabled "$section" "custom_download_subnets_list_enabled"
|
# config_get custom_download_subnets_list_enabled "$section" "custom_download_subnets_list_enabled"
|
||||||
|
|
||||||
if [ "$custom_domains_list_type" != "disabled" ] || [ "$custom_subnets_list_enabled" != "disabled" ] ||
|
if [ "$custom_domains_list_type" != "disabled" ] || [ "$custom_subnets_list_enabled" != "disabled" ] ||
|
||||||
[ "$custom_local_domains_list_enabled" = "1" ] || [ "$custom_download_domains_list_enabled" = "1" ] ||
|
[ "$custom_local_domains_list_enabled" = "1" ]; then
|
||||||
[ "$custom_download_subnets_list_enabled" = "1" ]; then
|
|
||||||
sing_box_rules "$section" "$section"
|
sing_box_rules "$section" "$section"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$custom_domains_list_type" != "disabled" ] || [ "$custom_local_domains_list_enabled" = "1" ] ||
|
if [ "$custom_domains_list_type" != "disabled" ] || [ "$custom_local_domains_list_enabled" = "1" ]; then
|
||||||
[ "$custom_download_domains_list_enabled" = "1" ]; then
|
|
||||||
sing_box_dns_rule_fakeip_section "$section" "$section"
|
sing_box_dns_rule_fakeip_section "$section" "$section"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -1297,7 +1418,7 @@ list_custom_url_domains_create() {
|
|||||||
|
|
||||||
while IFS= read -r domain; do
|
while IFS= read -r domain; do
|
||||||
log "From local file: $domain"
|
log "From local file: $domain"
|
||||||
sing_box_ruleset_domains $domain $section
|
sing_box_ruleset_domains_json $domain $section
|
||||||
done <"/tmp/podkop/$filename"
|
done <"/tmp/podkop/$filename"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1337,7 +1458,8 @@ list_custom_url_subnets_create() {
|
|||||||
|
|
||||||
while IFS= read -r subnet; do
|
while IFS= read -r subnet; do
|
||||||
log "From local file: $subnet"
|
log "From local file: $subnet"
|
||||||
sing_box_ruleset_subnets $subnet $section
|
sing_box_ruleset_subnets_json $subnet $section
|
||||||
|
nft add element inet PodkopTable podkop_subnets { $subnet }
|
||||||
done <"/tmp/podkop/$filename"
|
done <"/tmp/podkop/$filename"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1845,4 +1967,4 @@ case "$1" in
|
|||||||
echo "Usage: $0 {start|stop|restart|reload|enable|disable|main|list_update|check_proxy|check_nft|check_github|check_logs|check_sing_box_connections|check_sing_box_logs|check_dnsmasq|show_config|show_version|show_sing_box_config|show_luci_version|show_sing_box_version|show_system_info|get_status|get_sing_box_status}"
|
echo "Usage: $0 {start|stop|restart|reload|enable|disable|main|list_update|check_proxy|check_nft|check_github|check_logs|check_sing_box_connections|check_sing_box_logs|check_dnsmasq|show_config|show_version|show_sing_box_config|show_luci_version|show_sing_box_version|show_system_info|get_status|get_sing_box_status}"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
Reference in New Issue
Block a user