mirror of
https://github.com/vvzvlad/trickster-vpn.git
synced 2024-12-26 19:00:59 +03:00
add hostnames processing
This commit is contained in:
parent
eae6759ac8
commit
bc4924738c
@ -15,6 +15,7 @@ function ProgressBar {
|
|||||||
#Variables
|
#Variables
|
||||||
file_raw="russian_subnets_list_raw.txt"
|
file_raw="russian_subnets_list_raw.txt"
|
||||||
file_user="subnets_user_list.txt"
|
file_user="subnets_user_list.txt"
|
||||||
|
file_user_hostnames="hosts_user_list.txt"
|
||||||
file_for_calc="russian_subnets_list_raw_for_calc.txt"
|
file_for_calc="russian_subnets_list_raw_for_calc.txt"
|
||||||
file_processed="russian_subnets_list_processed.txt"
|
file_processed="russian_subnets_list_processed.txt"
|
||||||
gateway_for_internal_ip=`ip route | awk '/default/ {print $3; exit}'`
|
gateway_for_internal_ip=`ip route | awk '/default/ {print $3; exit}'`
|
||||||
@ -29,7 +30,15 @@ cat $file_raw |grep "-" > $file_for_calc
|
|||||||
cat $file_raw |grep -v "-" > $file_processed
|
cat $file_raw |grep -v "-" > $file_processed
|
||||||
for line in $(cat $file_for_calc); do ipcalc $line |grep -v "deaggregate" >> $file_processed; done
|
for line in $(cat $file_for_calc); do ipcalc $line |grep -v "deaggregate" >> $file_processed; done
|
||||||
|
|
||||||
if [ -e $file_user ]; then echo "Add user subnets..."; cat $file_user |grep -v "#" >> $file_processed; fi
|
if [ -e $file_user ]
|
||||||
|
then echo "Add user subnets..."
|
||||||
|
cat $file_user |grep -v "#" >> $file_processed
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e $file_user_hostnames ]
|
||||||
|
then echo "Add user hostnames..."
|
||||||
|
for line in $(cat $file_user_hostnames); do nslookup line |grep "Address" |grep -v "#" |awk '{print $2"/32"}' >> $file_processed; done
|
||||||
|
fi
|
||||||
|
|
||||||
#Flush route table
|
#Flush route table
|
||||||
echo "Flush route table (down interface $interface)..."
|
echo "Flush route table (down interface $interface)..."
|
||||||
|
Loading…
Reference in New Issue
Block a user