Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1392 → Rev 1393

/scripts/sbin/alcasar-bl.sh
38,18 → 38,23
 
# enable/disable the BL & WL categories
function cat_choice (){
# saving ip files and ossi category
# saving ossi category
mkdir $DIR_tmp
if [ $(find $DIR_IP_BL_ENABLED -name "ossi-*" | wc -l) -ne 0 ]
cp $DIR_IP_BL/ossi $DIR_tmp
if [ -d $DIR_IP_BL_ENABLED ]
then
cp $DIR_IP_BL_ENABLED/ossi-* $DIR_tmp
for file in `ls -1 $DIR_IP_BL_ENABLED | grep -v "^ossi-*"`
do
rm -f $DIR_IP_BL_ENABLED/$file
done
else
mkdir $DIR_IP_BL_ENABLED
chown apache $DIR_IP_BL_ENABLED
fi
cp $DIR_IP_BL/ossi $DIR_tmp
rm -rf $DIR_DNS_BL_ENABLED $DIR_DNS_WL_ENABLED $DIR_IP_BL_ENABLED # cleaning for dnsmasq and iptables
rm -rf $DIR_DNS_BL_ENABLED $DIR_DNS_WL_ENABLED # cleaning for dnsmasq and iptables
$SED "/\.Include/d" $DIR_DG/bannedsitelist $DIR_DG/bannedurllist # cleaning for DG
$SED "s?^[^#]?#&?g" $BL_CATEGORIES $WL_CATEGORIES # cleaning BL & WL categories file (comment all lines)
mkdir $DIR_DNS_BL_ENABLED $DIR_DNS_WL_ENABLED $DIR_IP_BL_ENABLED
chown apache $DIR_IP_BL_ENABLED
mkdir $DIR_DNS_BL_ENABLED $DIR_DNS_WL_ENABLED
# process the file $BL_CATEGORIES with the choice of categories
for ENABLE_CATEGORIE in `cat $BL_CATEGORIES_ENABLED`
do
74,10 → 79,6
# restoring ip files and ossi category
mv $DIR_tmp/ossi $DIR_IP_BL
chown apache $DIR_IP_BL/ossi
if [ $(find $DIR_tmp -name "ossi-*" | wc -l) -ne 0 ]
then
mv $DIR_tmp/ossi-* $DIR_IP_BL_ENABLED
fi
rm -rf $DIR_tmp
}
function bl_enable (){