Commit 1cea8b1b authored by Vitaly Lipatov's avatar Vitaly Lipatov

route-update.sh: filter out IPv4 addresses in IPv6 mode

When processing routes6.d, pure-IP list files may contain IPv4 addresses/subnets. Filter them out by only passing lines with ":" (IPv6 addresses) in IPv6 mode. Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent a9bed654
...@@ -248,7 +248,12 @@ process_routes() ...@@ -248,7 +248,12 @@ process_routes()
{ {
for f in $ip_lists ; do for f in $ip_lists ; do
grep -v '^#' "$f" | grep -v '^$' if [ "$ipcmd" = "ip -6" ] ; then
# IPv6 mode: only pass lines containing ":"
grep -v '^#' "$f" | grep -v '^$' | grep ':'
else
grep -v '^#' "$f" | grep -v '^$'
fi
done done
if [ -n "$domain_lists" ] ; then if [ -n "$domain_lists" ] ; then
for f in $domain_lists ; do for f in $domain_lists ; do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment