Subversion Repositories ALCASAR

Compare Revisions

Regard whitespace Rev 1913 → Rev 1912

/scripts/alcasar-bl.sh
45,7 → 45,9
 
# enable/disable the BL & WL categories
function cat_choice (){
# saving ossi category
mkdir $DIR_tmp
cp $DIR_IP_BL/ossi $DIR_tmp
#ip BL ENABLE
if [ -d $DIR_IP_BL_ENABLED ]
then
55,10 → 57,11
done
else
mkdir $DIR_IP_BL_ENABLED
chown root:apache $DIR_IP_BL_ENABLED
chmod 770 $DIR_IP_BL_ENABLED
chown dansguardian:apache $DIR_IP_BL_ENABLED
chmod g+w $DIR_IP_BL_ENABLED
fi
 
#dns BL ENABLED
if [ -d $DIR_DNS_BL_ENABLED ]
then
68,20 → 71,22
done
else
mkdir $DIR_DNS_BL_ENABLED
chown root:apache $DIR_DNS_BL_ENABLED
chmod 770 $DIR_DNS_BL_ENABLED
chown dansguardian:apache $DIR_DNS_BL_ENABLED
chmod g+w $DIR_DNS_BL_ENABLED
fi
#dns BL ossi.conf
if [ ! -e $DIR_DNS_BL/ossi.conf ]
#ip WL ENABLE
if [ -d $DIR_IP_WL ]
then
touch $DIR_DNS_BL/ossi.conf
chown root:apache $DIR_DNS_BL/ossi.conf
chmod g+w $DIR_DNS_BL/ossi.conf
if [ ! -e $DIR_DNS_BL_ENABLED/ossi ]
then
ln -s $DIR_DNS_BL/ossi.conf $DIR_DNS_BL_ENABLED/ossi
for file in `ls -1 $DIR_IP_WL | grep -v "^ossi*"`
do
rm -f $DIR_IP_WL/$file
done
else
mkdir $DIR_IP_WL
chown dansguardian:apache $DIR_IP_WL
chmod g+w $DIR_IP_WL
fi
fi
 
#ip WL ENABLE
if [ -d $DIR_IP_WL_ENABLED ]
92,9 → 97,10
done
else
mkdir $DIR_IP_WL_ENABLED
chown dansguardian:apache $DIR_IP_WL_ENABLED
chmod g+w $DIR_IP_WL_ENABLED
touch $DIR_IP_WL_ENABLED/ossi
chown -R root:apache $DIR_IP_WL_ENABLED
chmod 770 $DIR_IP_WL_ENABLED
chown dansguardian:apache $DIR_IP_WL_ENABLED/ossi
chmod g+w $DIR_IP_WL_ENABLED/ossi
fi
 
107,14 → 113,15
done
else
mkdir $DIR_DNS_WL_ENABLED
chown root:apache $DIR_DNS_WL_ENABLED
chmod 770 $DIR_DNS_WL_ENABLED
chown dansguardian:apache $DIR_DNS_WL_ENABLED
chmod g+w $DIR_DNS_WL_ENABLED
fi
#dns WL ossi.conf
if [ ! -e $DIR_DNS_WL/ossi.conf ]
then
touch $DIR_DNS_WL/ossi.conf
chown root:apache $DIR_DNS_WL/ossi.conf
chown dansguardian:apache $DIR_DNS_WL/ossi.conf
chmod g+w $DIR_DNS_WL/ossi.conf
if [ ! -e $DIR_DNS_WL_ENABLED/ossi ]
then
195,9 → 202,7
# Adapt Toulouse University BL to ALCASAR architecture (dnsmasq + DG + iptables)
-adapt | --adapt)
echo -n "Adaptation process of Toulouse University blackList. Please wait : "
# keep custom files (ossi) only when updating he BL
if [ -d $DIR_IP_BL -a -d $DIR_IP_WL -a -d $DIR_DNS_BL -a -d $DIR_DNS_WL ]
then
# keep custom files (ossi)
for x in $(ls -1 $DIR_IP_BL | grep "^ossi*")
do
mv $DIR_IP_BL/$x $tmp_DIR_IP_BL
214,7 → 219,6
do
mv $DIR_DNS_WL/$x $tmp_DIR_DNS_WL
done
fi
if [ -f $DIR_tmp/blacklists.tar.gz ] # when downloading the last version of the BL
then
rm -rf $DIR_DG_BL $DIR_IP_BL