17,7 → 17,6 |
DIR_tmp="/tmp/blacklists" |
FILE_tmp="/tmp/filesfilter.txt" |
FILE_ip_tmp="/tmp/filesipfilter.txt" |
FILE_IP_WL="/usr/local/share/ossi_wl" |
DIR_DG="/etc/dansguardian/lists" |
DIR_DG_BL="$DIR_DG/blacklists" |
BL_CATEGORIES="$DIR_CONF/alcasar-bl-categories" # list of names of the BL categories |
25,10 → 24,11 |
BL_CATEGORIES_ENABLED="$DIR_CONF/alcasar-bl-categories-enabled" # ' ' BL enabled categories |
WL_CATEGORIES_ENABLED="$DIR_CONF/alcasar-wl-categories-enabled" # ' ' WL enabled categories |
DIR_SHARE="/usr/local/share" |
FILE_IP_WL="$DIR_SHARE/ossi_wl" |
DIR_DNS_BL="$DIR_SHARE/dnsmasq-bl" # all the BL in the DNSMASQ format |
DIR_DNS_WL="$DIR_SHARE/dnsmasq-wl" # all the WL ' ' ' |
DIR_IP_BL="$DIR_SHARE/iptables-bl" # all the IP addresses of the BL |
DIR_DNS_BL_ENABLED="$DIR_SHARE/dnsmasq-bl-enabled" # symbolic link to the dnsmasq BL (only enabled categories) |
DIR_DNS_BL_ENABLED="$DIR_SHARE/dnsmasq-bl-enabled" # symbolic link to the domains BL (only enabled categories) |
DIR_DNS_WL_ENABLED="$DIR_SHARE/dnsmasq-wl-enabled" # ' ' ' WL ' ' ' |
DIR_IP_BL_ENABLED="$DIR_SHARE/iptables-bl-enabled" # ' ' ip BL (only enabled categories) |
DNSMASQ_BL_CONF="/etc/dnsmasq-blacklist.conf" # conf file of dnsmasq-blacklist |
149,10 → 149,10 |
chown apache $FILE_IP_WL |
fi |
# Saving ossi category |
cp $DIR_IP_BL/ossi $DIR_tmp/ossi-ip |
if [ -f $DIR_tmp/blacklists.tar.gz ] |
then |
[ -d $DIR_DG_BL/ossi ] && mv -f $DIR_DG_BL/ossi $DIR_tmp |
[ -d $DIR_DG_BL/ossi ] && mv $DIR_DG_BL/ossi $DIR_tmp |
[ -e $DIR_IP_BL/ossi ] && mv $DIR_IP_BL/ossi $DIR_tmp/ossi-ip |
rm -rf $DIR_DG_BL |
mkdir $DIR_DG_BL |
tar zxf $DIR_tmp/blacklists.tar.gz --directory=$DIR_DG/ |
223,12 → 223,9 |
done |
done |
rm -f $FILE_tmp $FILE_ip_tmp |
# Restoring ossi category |
mv $DIR_tmp/ossi-ip $DIR_IP_BL/ossi |
# Restoring whitelist ip |
if [ -e $DIR_tmp/ossi_wl ] |
then |
mv $DIR_tmpi/ossi_wl /usr/local/share/ |
# Restoring ossi files |
[ -e $DIR_tmp/ossi-ip ] && mv $DIR_tmp/ossi-ip $DIR_IP_BL/ossi |
[ -e $DIR_tmp/ossi_wl ] && mv $DIR_tmpi/ossi_wl $DIR_SHARE/ossi_wl |
fi |
rm -rf $DIR_tmp |
echo |