forked from emdarx/X-Panel-SSH-User-Management
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblock_iran.sh
22 lines (21 loc) · 792 Bytes
/
block_iran.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
#Alireza
sudo apt-get install curl unzip perl &
sudo apt-get install xtables-addons-common -y
sudo apt-get install libtext-csv-xs-perl libmoosex-types-netaddr-ip-perl -y
wait
sudo mkdir /usr/share/xt_geoip
sudo mkdir /usr/lib/xtables-addons/
sudo mkdir /usr/lib/xtables-addons/xt_geoip_build
chmod 777 /usr/lib/xtables-addons/xt_geoip_build
wait
MON=$(date +"%m")
YR=$(date +"%Y")
wget https://download.db-ip.com/free/dbip-country-lite-${YR}-${MON}.csv.gz -O /usr/share/xt_geoip/dbip-country-lite.csv.gz
gunzip /usr/share/xt_geoip/dbip-country-lite.csv.gz
/usr/lib/xtables-addons/xt_geoip_build -D /usr/share/xt_geoip/ -S /usr/share/xt_geoip/
rm /usr/share/xt_geoip/dbip-country-lite.csv
modprobe xt_geoip
lsmod | grep ^xt_geoip
wait
printf "\n Download Success GEOIP Library \n"