Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 1383 → Rev 1384

/alcasar.sh
1394,7 → 1394,11
##########################################################
BL ()
{
# copy and extract of Toulouse BL
# modify iptables init script in order to load the ipsets
[ -e /usr/libexec/iptables.init.default ] || cp /usr/libexec/iptables.init /usr/libexec/iptables.init.default
sed -i 's/^IPTABLES_CONFIG=\/etc\/sysconfig\/iptables/IPTABLES_CONFIG=\/etc\/sysconfig\/iptables\nIPSET_CONFIG=\/etc\/sysconfig\/ipset_save/' /usr/libexec/iptables.init
sed -i 's/if \[ -f \$IPTABLES_CONFIG \]; then/if \[ -f \$IPSET_CONFIG \] \&\& \[ -f \$IPTABLES_CONFIG \]; then\n\t\t\/sbin\/ipset -! restore < \$IPSET_CONFIG/' /usr/libexec/iptables.init
# copy and extract toulouse BL
rm -rf $DIR_DG/lists/blacklists
tar zxf $DIR_CONF/blacklists.tar.gz --directory=$DIR_DG/lists/ > /dev/null 2>&1
# creation of the OSSI BL and WL categories (domain name and url)
1401,6 → 1405,9
mkdir $DIR_DG/lists/blacklists/ossi
touch $DIR_DG/lists/blacklists/ossi/domains $DIR_DG/lists/blacklists/ossi/domains_wl
touch $DIR_DG/lists/blacklists/ossi/urls $DIR_DG/lists/blacklists/ossi/urls_wl
touch $DIR_DEST_SHARE/iptables-wl/ossi
chown -R dansguardian:apache $DIR_DG $DIR_DEST_SHARE
chmod -R g+rw $DIR_DG $DIR_DEST_SHARE
# creation of file for the rehabilited domains and urls
[ -e $DIR_DG/lists/exceptionsitelist.default ] || mv $DIR_DG/lists/exceptionsitelist $DIR_DG/lists/exceptionsitelist.default
[ -e $DIR_DG/lists/exceptionurllist.default ] || mv $DIR_DG/lists/exceptionurllist $DIR_DG/lists/exceptionurllist.default
1430,12 → 1437,11
EOF
# change the the google safesearch ("safe=strict" instead of "safe=vss")
$SED "s?safe=vss?safe=strict?g" $DIR_DG/lists/urlregexplist
chown -R dansguardian:apache $DIR_DG
chmod -R g+rw $DIR_DG
# adapt the BL to ALCASAR architecture. Enable the default categories
if [ "$mode" != "update" ]; then
$DIR_DEST_SBIN/alcasar-bl.sh --adapt
$DIR_DEST_SBIN/alcasar-bl.sh --cat_choice
$DIR_DEST_SBIN/alcasar-bl.sh --ip_retrieving
fi
}
 
/scripts/sbin/alcasar-uninstall.sh
132,8 → 132,8
 
#nfsen
echo -en "\n- nfsen(2) : "
[ `grep "^nfsen:" /etc/passwd | wc -l` == 1 ] && userdel -r nfsen 2>/dev/null && echo -n "1, "
[ `grep "^www-data:" /etc/group | wc -l` == 1 ] && userdel -r www-data 2>/dev/null && groupdel www-data 2>/dev/null && echo -n "2"
[ `grep "^nfsen:" /etc/passwd | wc -l` == 1 ] && userdel -r nfsen 2>/dev/null && echo -n "1, "
[ `grep "^www-data:" /etc/group | wc -l` == 1 ] && userdel -r www-data 2>/dev/null && groupdel www-data 2>/dev/null && echo -n "2"
 
# We keep netflow RRD DB for the moment
#[ -d /var/log/netflow ] && rm -rf /var/log/netflow && echo -n "3"
154,6 → 154,10
fi
sleep 1
 
#BL
echo -en "\n- BL(1) : "
[ -e /usr/libexec/iptables.init.default ] && mv /usr/libexec/iptables.init.default /usr/libexec/iptables.init && echo "1"
sleep 1
 
#dhcpd
echo -en "\n- dhcp-server(1) : "
179,6 → 183,13
rm -f /etc/cron.d/coova /etc/cron.d/alcasar-bl_download
sleep 1
 
#gammu-smsd
echo -en "\n- gammu-smsd(3) :"
[ -e /etc/gammu_smsd_conf ] && rm -f /etc/gammu_smsd_conf && echo -n "1, "
[ -e /etc/udev/rules.d/66-huawei.rules ] && rm -f /etc/udev/rules.d/66-huawei.rules && echo -n "2, "
[ -e /var/log/gammu-smsd ] && rm -rf /var/log/gammu-smsd && echo ,-n "3"
echo -n "1"
 
#network
echo -en "\n- network(9) : "
hostname localhost
219,13 → 230,8
[ -e /lib/systemd/system/alcasar-load_balancing.service ] && rm -f /lib/systemd/system/alcasar-load_balancing.service && echo -n "12"
sleep 1
 
#gammu-smsd
echo -en "\n- gammu-smsd(3) :"
[ -e /etc/gammu_smsd_conf ] && rm -f /etc/gammu_smsd_conf && echo -n "1, "
[ -e /etc/udev/rules.d/66-huawei.rules ] && rm -f /etc/udev/rules.d/66-huawei.rules && echo -n "2, "
[ -e /var/log/gammu-smsd ] && rm -rf /var/log/gammu-smsd && echo ,-n "3"
echo -n "1"
 
 
#nettoyage (on retire les services supprimés ou remplacés dans la nouvelle version)
echo -en "\n- cleaning() : "
for rm_fic in /usr/local/bin /usr/local/sbin /usr/local/etc