Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar.sh 1928 2016-06-05 21:52:03Z richard $
|
2 |
# $Id: alcasar.sh 1930 2016-06-08 22:00:48Z richard $
|
3 |
|
3 |
|
4 |
# alcasar.sh
|
4 |
# alcasar.sh
|
5 |
|
5 |
|
6 |
# ALCASAR Install script - CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...]
|
6 |
# ALCASAR Install script - CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...]
|
7 |
# Ce programme est un logiciel libre ; This software is free and open source
|
7 |
# Ce programme est un logiciel libre ; This software is free and open source
|
Line 1593... |
Line 1593... |
1593 |
##########################################################
|
1593 |
##########################################################
|
1594 |
## Fonction "BL" ##
|
1594 |
## Fonction "BL" ##
|
1595 |
##########################################################
|
1595 |
##########################################################
|
1596 |
BL ()
|
1596 |
BL ()
|
1597 |
{
|
1597 |
{
|
1598 |
# copy and extract Toulouse university BL
|
1598 |
# copy the Toulouse university BL in order to be adapted to ALCASAR architecture (alcasar-bl.sh -adapt)
|
1599 |
rm -rf $DIR_DG/lists/blacklists
|
1599 |
rm -rf $DIR_DG/lists/blacklists
|
- |
|
1600 |
mkdir -p /tmp/blacklists
|
1600 |
tar zxf $DIR_CONF/blacklists.tar.gz --directory=$DIR_DG/lists/ > /dev/null 2>&1
|
1601 |
cp $DIR_CONF/blacklists.tar.gz /tmp/blacklists/
|
1601 |
# creation of file for the rehabilited domains and urls
|
1602 |
# creation of file for the rehabilited domains and urls
|
1602 |
[ -e $DIR_DG/lists/exceptionsitelist.default ] || mv $DIR_DG/lists/exceptionsitelist $DIR_DG/lists/exceptionsitelist.default
|
1603 |
[ -e $DIR_DG/lists/exceptionsitelist.default ] || mv $DIR_DG/lists/exceptionsitelist $DIR_DG/lists/exceptionsitelist.default
|
1603 |
[ -e $DIR_DG/lists/exceptionurllist.default ] || mv $DIR_DG/lists/exceptionurllist $DIR_DG/lists/exceptionurllist.default
|
1604 |
[ -e $DIR_DG/lists/exceptionurllist.default ] || mv $DIR_DG/lists/exceptionurllist $DIR_DG/lists/exceptionurllist.default
|
1604 |
touch $DIR_DG/lists/exceptionsitelist
|
1605 |
touch $DIR_DG/lists/exceptionsitelist
|
1605 |
touch $DIR_DG/lists/exceptionurllist
|
1606 |
touch $DIR_DG/lists/exceptionurllist
|
Line 1625... |
Line 1626... |
1625 |
EOF
|
1626 |
EOF
|
1626 |
# change the google safesearch ("safe=strict" instead of "safe=vss")
|
1627 |
# change the google safesearch ("safe=strict" instead of "safe=vss")
|
1627 |
$SED "s?safe=vss?safe=strict?g" $DIR_DG/lists/urlregexplist
|
1628 |
$SED "s?safe=vss?safe=strict?g" $DIR_DG/lists/urlregexplist
|
1628 |
# creation of the custom BL and WL categorie named "ossi" (for domain names & ip only)
|
1629 |
# creation of the custom BL and WL categorie named "ossi" (for domain names & ip only)
|
1629 |
if [ "$mode" != "update" ]; then
|
1630 |
if [ "$mode" != "update" ]; then
|
1630 |
mkdir $DIR_DG/lists/blacklists/ossi-bl
|
1631 |
mkdir -p $DIR_DG/lists/blacklists/ossi-bl
|
1631 |
touch $DIR_DG/lists/blacklists/ossi-bl/domains
|
1632 |
touch $DIR_DG/lists/blacklists/ossi-bl/domains
|
1632 |
mkdir $DIR_DG/lists/blacklists/ossi-wl
|
1633 |
mkdir -p $DIR_DG/lists/blacklists/ossi-wl
|
1633 |
touch $DIR_DG/lists/blacklists/ossi-wl/domains
|
1634 |
touch $DIR_DG/lists/blacklists/ossi-wl/domains
|
1634 |
# add custom ALCASAR BL files
|
1635 |
# add custom ALCASAR BL files
|
1635 |
for x in $(ls $DIR_CONF/etc/ | grep "^ossi-*")
|
1636 |
for x in $(ls $DIR_CONF | grep "^ossi-*")
|
1636 |
do
|
1637 |
do
|
1637 |
mkdir $DIR_DG/lists/blacklists/$x
|
1638 |
mkdir $DIR_DG/lists/blacklists/$x
|
1638 |
cp $DIR_CONF/etc/$x $DIR_DG/lists/blacklists/$x/domains
|
1639 |
cp $DIR_CONF/$x $DIR_DG/lists/blacklists/$x/domains
|
1639 |
done
|
1640 |
done
|
1640 |
chown -R dansguardian:apache $DIR_DG $DIR_DEST_SHARE
|
1641 |
chown -R dansguardian:apache $DIR_DG $DIR_DEST_SHARE
|
1641 |
chmod -R g+rw $DIR_DG $DIR_DEST_SHARE
|
1642 |
chmod -R g+rw $DIR_DG $DIR_DEST_SHARE
|
1642 |
# adapt the Toulouse BL to ALCASAR architecture
|
1643 |
# adapt the Toulouse BL to ALCASAR architecture
|
1643 |
$DIR_DEST_BIN/alcasar-bl.sh --adapt
|
1644 |
$DIR_DEST_BIN/alcasar-bl.sh --adapt
|