Commit e93d3bb4 authored by Vitaly Lipatov's avatar Vitaly Lipatov

router: add skip egw

parent 90d69600
#!/bin/sh
SETNAME=rkz
arg=$1
get_ipv4_list()
{
echo "$1" | grep -q "[a-z]" || return 0
dig "$1" A | grep -v "^;" | grep "IN[[:space:]]*A[[:space:]]" | sed -e "s|.*[[:space:]]||"
}
for ip in $(get_ipv4_list $arg); do
echo "add $ip"
ipset add $SETNAME $ip || exit
echo "$ip" >> a_manual.list
done
#!/bin/sh
#exit
# Usage: --show|--force
cd $(dirname "$(realpath "$0")") || exit #"
SETNAME=rkz
TODEL="$1"
ipset list $SETNAME | grep $TODEL
#!/bin/sh
SETNAME=rkz
arg=$1
get_ipv4_list()
{
echo "$1" | grep -q "[a-z]" || return 0
dig "$1" A | grep -v "^;" | grep "IN[[:space:]]*A[[:space:]]" | sed -e "s|.*[[:space:]]||"
}
for ip in $(get_ipv4_list $arg); do
echo "add $ip"
ipset del $SETNAME $ip
echo "$ip" >> a_no_egw.list
done
......@@ -88,6 +88,11 @@ ipset destroy $TMPNAME 2>/dev/null
( echo "create $TMPNAME $IPSTYPE hashsize 65536 maxelem $MAXELEM" ; \
cat $0.list | grep -v "^$" | grep -v ":" | sed -e "s|^|add $TMPNAME |" ) | ipset -exist restore
# remove skipped ip
cat a_no_egw.list | grep -v "^ *#" | while read ip ; do
ipset del $TMPNAME $ip
done
ipset list $TMPNAME >$0.ipv4
ipset list $TMPNAME | wc -l >$0.count
ipset list $TMPNAME | grep "/" >$0.subnet
......
#!/bin/sh
SETNAME=rkz
ip=$1
if echo "$ip" | grep -q "[a-z]" ; then
ip=$(resolve -s $ip)
fi
ipset add $SETNAME $ip
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