Subversion Repositories ALCASAR

Rev

Rev 1930 | Rev 1940 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1930 Rev 1938
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 1930 2016-06-08 22:00:48Z richard $ 
2
#  $Id: alcasar.sh 1938 2016-06-12 15:12:06Z 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 54... Line 54...
54
mode="install"
54
mode="install"
55
# ******* Files parameters - paramètres fichiers *********
55
# ******* Files parameters - paramètres fichiers *********
56
DIR_INSTALL=`pwd`				# current directory 
56
DIR_INSTALL=`pwd`				# current directory 
57
DIR_CONF="$DIR_INSTALL/conf"			# install directory (with conf files)
57
DIR_CONF="$DIR_INSTALL/conf"			# install directory (with conf files)
58
DIR_SCRIPTS="$DIR_INSTALL/scripts"		# install directory (with script files)
58
DIR_SCRIPTS="$DIR_INSTALL/scripts"		# install directory (with script files)
-
 
59
DIR_BLACKLIST="$DIR_INSTALL/blacklist"		# install directory (with blacklist files)
59
DIR_SAVE="/var/Save"				# backup directory (traceability_log, user_db, security_log)
60
DIR_SAVE="/var/Save"				# backup directory (traceability_log, user_db, security_log)
60
DIR_WEB="/var/www/html"				# directory of APACHE
61
DIR_WEB="/var/www/html"				# directory of APACHE
61
DIR_DG="/etc/dansguardian"			# directory of DansGuardian
62
DIR_DG="/etc/dansguardian"			# directory of DansGuardian
62
DIR_ACC="$DIR_WEB/acc"				# directory of the 'ALCASAR Control Center'
63
DIR_ACC="$DIR_WEB/acc"				# directory of the 'ALCASAR Control Center'
63
DIR_DEST_BIN="/usr/local/bin"			# directory of ALCASAR scripts
64
DIR_DEST_BIN="/usr/local/bin"			# directory of ALCASAR scripts
Line 1596... Line 1597...
1596
BL ()
1597
BL ()
1597
{
1598
{
1598
	# copy the Toulouse university BL in order to be adapted to ALCASAR architecture (alcasar-bl.sh -adapt)
1599
	# copy the Toulouse university BL in order to be adapted to ALCASAR architecture (alcasar-bl.sh -adapt)
1599
	rm -rf $DIR_DG/lists/blacklists
1600
	rm -rf $DIR_DG/lists/blacklists
1600
	mkdir -p /tmp/blacklists
1601
	mkdir -p /tmp/blacklists
1601
	cp $DIR_CONF/blacklists.tar.gz /tmp/blacklists/
1602
	cp $DIR_BLACKLIST/blacklists.tar.gz /tmp/blacklists/
1602
# creation of file for the rehabilited domains and urls
1603
# creation of file for the rehabilited domains and urls
1603
	[ -e $DIR_DG/lists/exceptionsitelist.default ] || mv $DIR_DG/lists/exceptionsitelist $DIR_DG/lists/exceptionsitelist.default
1604
	[ -e $DIR_DG/lists/exceptionsitelist.default ] || mv $DIR_DG/lists/exceptionsitelist $DIR_DG/lists/exceptionsitelist.default
1604
	[ -e $DIR_DG/lists/exceptionurllist.default ] || mv $DIR_DG/lists/exceptionurllist $DIR_DG/lists/exceptionurllist.default
1605
	[ -e $DIR_DG/lists/exceptionurllist.default ] || mv $DIR_DG/lists/exceptionurllist $DIR_DG/lists/exceptionurllist.default
1605
	touch $DIR_DG/lists/exceptionsitelist
1606
	touch $DIR_DG/lists/exceptionsitelist
1606
	touch $DIR_DG/lists/exceptionurllist
1607
	touch $DIR_DG/lists/exceptionurllist
Line 1631... Line 1632...
1631
		mkdir -p $DIR_DG/lists/blacklists/ossi-bl
1632
		mkdir -p $DIR_DG/lists/blacklists/ossi-bl
1632
		touch $DIR_DG/lists/blacklists/ossi-bl/domains
1633
		touch $DIR_DG/lists/blacklists/ossi-bl/domains
1633
		mkdir -p $DIR_DG/lists/blacklists/ossi-wl
1634
		mkdir -p $DIR_DG/lists/blacklists/ossi-wl
1634
		touch $DIR_DG/lists/blacklists/ossi-wl/domains
1635
		touch $DIR_DG/lists/blacklists/ossi-wl/domains
1635
# add custom ALCASAR BL files
1636
# add custom ALCASAR BL files
1636
		for x in $(ls $DIR_CONF | grep "^ossi-*")
1637
		for x in $(ls $DIR_BLACKLIST | grep -v "^blacklist")
1637
		do
1638
		do
1638
			mkdir $DIR_DG/lists/blacklists/$x
1639
			mkdir $DIR_DG/lists/blacklists/ossi-bl-$x
1639
			cp $DIR_CONF/$x  $DIR_DG/lists/blacklists/$x/domains
1640
			cp $DIR_BLACKLIST/$x  $DIR_DG/lists/blacklists/ossi-bl-$x/domains
1640
		done
1641
		done
1641
		chown -R dansguardian:apache $DIR_DG $DIR_DEST_SHARE
1642
		chown -R dansguardian:apache $DIR_DG $DIR_DEST_SHARE
1642
		chmod -R g+rw $DIR_DG $DIR_DEST_SHARE
1643
		chmod -R g+rw $DIR_DG $DIR_DEST_SHARE
1643
# adapt the Toulouse BL to ALCASAR architecture
1644
# adapt the Toulouse BL to ALCASAR architecture
1644
		$DIR_DEST_BIN/alcasar-bl.sh --adapt
1645
		$DIR_DEST_BIN/alcasar-bl.sh --adapt