Skip to content

Commit

Permalink
qzeleza#222 возможное заполнение ipset
Browse files Browse the repository at this point in the history
  • Loading branch information
AltGrF13 authored and AltGrF13 committed Nov 24, 2024
1 parent a8f3c61 commit 2b31994
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions opt/bin/libs/vpn
Original file line number Diff line number Diff line change
Expand Up @@ -2603,6 +2603,16 @@ host_add() {

[ -f /opt/etc/AdGuardHome/AdGuardHome.yaml ] && cmd_adguardhome_status | grep -q ВКЛЮЧЕН && add_host_to_adguard "${clear_host}" &> /dev/null

if echo "${clear_host}" | grep -qE "$(get_regexp_ip_or_range)" ; then
# если строка IP, диапазон или маска; то добавляем напрямую и без ttl
ipset -exist add "${IPSET_TABLE_NAME}" "${clear_host}" timeout 0 &>/dev/null
elif [ "${wild}" != 'import' ] && [ "${reset}" = 'yes' ] ; then
# если это одиночное добавление, то можем
# прогреть переданный домен (без под*),
# чтобы пользователю не пришлось сбрасывать кэш DNS
add_host_by_iplist_to_ipset "${clear_host}" &> /dev/null
fi

[ $? = 0 ] && when_ok "ДОБАВЛЕН" || when_bad "НЕ ДОБАВЛЕН"


Expand Down

0 comments on commit 2b31994

Please sign in to comment.