Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1385 → Rev 1386

/scripts/sbin/alcasar-bl.sh
43,7 → 43,10
function cat_choice (){
# saving ip files and ossi category
mkdir $DIR_tmp
cp $DIR_IP_BL_ENABLED/ossi-* $DIR_tmp
if [ $(find $DIR_IP_BL_ENABLED -name "ossi-*" | wc -l) -ne 0 ]
then
cp $DIR_IP_BL_ENABLED/ossi-* $DIR_tmp
fi
cp $DIR_IP_BL/ossi $DIR_tmp
rm -rf $DIR_DNS_BL_ENABLED $DIR_DNS_WL_ENABLED $DIR_IP_BL_ENABLED $DIR_IP_WL_ENABLED # cleaning for dnsmasq and iptables
$SED "/\.Include/d" $DIR_DG/bannedsitelist $DIR_DG/bannedurllist # cleaning for DG
75,7 → 78,10
# restoring ip files and ossi category
mv $DIR_tmp/ossi $DIR_IP_BL
chown apache $DIR_IP_BL/ossi
mv $DIR_tmp/ossi-* $DIR_IP_BL_ENABLED
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 (){
110,8 → 116,15
if [ ! -d $DIR_IP_WL ]
then
mkdir $DIR_IP_WL
touch $DIR_IP_WL/ossi
chown apache $DIR_IP_WL/ossi
else
# delete old IPs
mkdir $DIR_tmp
cp $DIR_IP_WL/ossi $DIR_tmp
rm -rf $DIR_IP_WL/*
cp $DIR_tmp/ossi $DIR_IP_WL
rm -rf $DIR_tmp
fi
echo "Retrieving IPs :"
cd $DIR_DNS_WL
131,7 → 144,7
done
done
echo "done"
sleep 2
sleep 5
cd $DIR_IP_WL
for category in `ls`
do
155,7 → 168,7
do
echo `host $domain | grep -oE '([0-9]{1,3}\.){3}[0-9]{1,3}'` >> $OSSI_WL_IP &
done
sleep 2
sleep 5
# one IP per line
$SED 's/ /\n/g' $OSSI_WL_IP
# add SET syntax
/scripts/sbin/alcasar-uninstall.sh
156,7 → 156,7
 
#BL
echo -en "\n- BL(1) : "
[ -e /usr/libexec/iptables.init.default ] && mv /usr/libexec/iptables.init.default /usr/libexec/iptables.init && echo "1"
[ -e /lib/systemd/system/iptables.service.default ] && mv /lib/systemd/system/iptables.service.default /lib/systemd/system/iptables.service && echo "1"
sleep 1
 
#dhcpd