Merge branch 'main' into main
This commit is contained in:
@@ -11,6 +11,8 @@ config main 'main'
|
||||
option custom_domains_list_type 'disable'
|
||||
#list custom_domains ''
|
||||
#option custom_domains_text ''
|
||||
option custom_local_domains_list_enabled '0'
|
||||
#list custom_local_domains ''
|
||||
option custom_download_domains_list_enabled '0'
|
||||
#list custom_download_domains ''
|
||||
option custom_domains_list_type 'disable'
|
||||
|
||||
@@ -403,6 +403,13 @@ list_update() {
|
||||
fi
|
||||
|
||||
# Main domains delist
|
||||
config_get_bool custom_local_domains_list_enabled "main" "custom_local_domains_list_enabled" "0"
|
||||
if [ "$custom_local_domains_list_enabled" -eq 1 ]; then
|
||||
log "Adding a custom local domain list"
|
||||
add_set "podkop_domains" "main"
|
||||
config_list_foreach main custom_local_domains "list_custom_local_domains_create" "podkop"
|
||||
fi
|
||||
|
||||
config_get_bool delist_domains_enabled "main" "delist_domains_enabled" "0"
|
||||
if [ "$delist_domains_enabled" -eq 1 ] && [ "$domain_list_enabled" -eq 1 ]; then
|
||||
log "Exclude domains from the common list"
|
||||
@@ -765,6 +772,19 @@ list_custom_domains_create() {
|
||||
log "$domain added to the list"
|
||||
}
|
||||
|
||||
list_custom_local_domains_create() {
|
||||
local local_file="$1"
|
||||
local name="$2"
|
||||
local filename=$(basename "$local_file" | cut -d. -f1)
|
||||
local config="/tmp/dnsmasq.d/${name}-${filename}.lst"
|
||||
|
||||
rm -f $config
|
||||
while IFS= read -r domain; do
|
||||
echo "nftset=/$domain/4#inet#PodkopTable#${name}_domains" >>$config
|
||||
done <"$local_file"
|
||||
dnsmasq_config_check ${name}-${filename}.lst
|
||||
}
|
||||
|
||||
list_custom_download_domains_create() {
|
||||
local URL="$1"
|
||||
local name="$2"
|
||||
|
||||
Reference in New Issue
Block a user