Subversion Repositories ALCASAR

Rev

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

Rev 316 Rev 323
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
#  $Id: alcasar.sh 316 2010-11-14 22:25:53Z richard $ 
2
#  $Id: alcasar.sh 323 2010-11-16 22:48:34Z richard $ 
3
 
3
 
4
# alcasar.sh
4
# alcasar.sh
5
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
5
# by Franck BOUIJOUX, Pascal LEVANT and Richard REY
6
# This script is distributed under the Gnu General Public License (GPL)
6
# This script is distributed under the Gnu General Public License (GPL)
7
 
7
 
Line 214... Line 214...
214
# On supprime les paquetages, les services et les utilisateurs inutiles
214
# On supprime les paquetages, les services et les utilisateurs inutiles
215
	for rm_rpm in dhcp-server avahi mandi shorewall libc-icap0 cyrus-sasl
215
	for rm_rpm in dhcp-server avahi mandi shorewall libc-icap0 cyrus-sasl
216
	do
216
	do
217
		/usr/sbin/urpme --auto $rm_rpm --auto-orphans
217
		/usr/sbin/urpme --auto $rm_rpm --auto-orphans
218
	done
218
	done
219
	for svc in alsa sound dm atd dc_server
219
	for svc in alsa sound dm atd dc_server netfs bootlogd stop-bootlogd
220
	do
220
	do
221
		/sbin/chkconfig --del $svc
221
		/sbin/chkconfig --del $svc
222
	done
222
	done
223
	for rm_users in avahi-autoipd avahi icapd
223
	for rm_users in avahi-autoipd avahi icapd
224
	do
224
	do
Line 456... Line 456...
456
	echo "$VERSION du $DATE" > $DIR_WEB/VERSION
456
	echo "$VERSION du $DATE" > $DIR_WEB/VERSION
457
	$SED "s?99/99/9999?$DATE_SHORT?g" $DIR_ACC/menu.php
457
	$SED "s?99/99/9999?$DATE_SHORT?g" $DIR_ACC/menu.php
458
	$SED "s?\$DB_RADIUS = .*?\$DB_RADIUS = \"$DB_RADIUS\"\;?g" $DIR_ACC/phpsysinfo/includes/xml/portail.php
458
	$SED "s?\$DB_RADIUS = .*?\$DB_RADIUS = \"$DB_RADIUS\"\;?g" $DIR_ACC/phpsysinfo/includes/xml/portail.php
459
	$SED "s?\$DB_USER = .*?\$DB_USER = \"$DB_USER\"\;?g" $DIR_ACC/phpsysinfo/includes/xml/portail.php
459
	$SED "s?\$DB_USER = .*?\$DB_USER = \"$DB_USER\"\;?g" $DIR_ACC/phpsysinfo/includes/xml/portail.php
460
	$SED "s?\$radiuspwd = .*?\$radiuspwd = \"$radiuspwd\"\;?g" $DIR_ACC/phpsysinfo/includes/xml/portail.php
460
	$SED "s?\$radiuspwd = .*?\$radiuspwd = \"$radiuspwd\"\;?g" $DIR_ACC/phpsysinfo/includes/xml/portail.php
-
 
461
	$SED "s?^\$private_ip =.*?\$private_ip = \"$PRIVATE_IP\";?g" $DIR_WEB/index-access-deny.php $DIR_WEB/index-network-pb.php
461
	chmod 640 $DIR_ACC/phpsysinfo/includes/xml/portail.php
462
	chmod 640 $DIR_ACC/phpsysinfo/includes/xml/portail.php
462
	chown -R apache:apache $DIR_WEB/*
463
	chown -R apache:apache $DIR_WEB/*
463
	for i in ISO base logs/firewall logs/httpd logs/squid ;
464
	for i in ISO base logs/firewall logs/httpd logs/squid ;
464
	do
465
	do
465
		[ -d $DIR_SAVE/$i ] || mkdir -p $DIR_SAVE/$i
466
		[ -d $DIR_SAVE/$i ] || mkdir -p $DIR_SAVE/$i
Line 486... Line 487...
486
</body>
487
</body>
487
</html>
488
</html>
488
EOF
489
EOF
489
	echo "- URL d'accès au centre de gestion : https://$PRIVATE_IP" >> $FIC_PARAM
490
	echo "- URL d'accès au centre de gestion : https://$PRIVATE_IP" >> $FIC_PARAM
490
	echo "                                  ou https://alcasar" >> $FIC_PARAM
491
	echo "                                  ou https://alcasar" >> $FIC_PARAM
491
# On crée le VirtualHost pour l'accès au port 80 (page de filtrage de domaine)
-
 
492
# Utilisé pour :
-
 
493
# 	- la redirection après filtrage
-
 
494
#	- la redirection suite à l'indisponibilité d'Internet (via watchdog)
-
 
495
#	- l'accès au centre de gestion (lien https)
-
 
496
# On utilise la réécriture d'URL pour rediriger toute les URLs 
-
 
497
#	FIC_VIRTUAL=`find /etc/httpd/conf -type f -name *default_vhosts*`
-
 
498
#	[ -e /etc/httpd/conf/vhosts.default ]  || cp $FIC_VIRTUAL /etc/httpd/conf/vhosts.default
-
 
499
#	cat <<EOF > $FIC_VIRTUAL
-
 
500
#NameVirtualHost *:80
-
 
501
#<VirtualHost *:80>
-
 
502
#ServerName $HOSTNAME
-
 
503
#DocumentRoot $DIR_WEB/redirect
-
 
504
#RewriteEngine on
-
 
505
#RewriteRule ^.*logo-alcasar.* /logo-alcasar.png [L]
-
 
506
#RewriteRule ^(.*)$ /index.php [L]
-
 
507
#</VirtualHost>
-
 
508
#EOF
-
 
509
#	$SED "s?^\$private_ip =.*?\$private_ip = \"$PRIVATE_IP\";?g" $DIR_WEB/redirect/index-access-deny.php $DIR_WEB/redirect/index-network-pb.php
-
 
510
# Définition du premier compte lié au profil 'admin'
492
# Définition du premier compte lié au profil 'admin'
511
	if [ "$mode" = "install" ]
493
	if [ "$mode" = "install" ]
512
	then
494
	then
513
		header_install
495
		header_install
514
		echo "Pour administrer Alcasar via le centre de gestion WEB, trois profils de comptes ont été définis :"
496
		echo "Pour administrer Alcasar via le centre de gestion WEB, trois profils de comptes ont été définis :"
Line 1097... Line 1079...
1097
	touch /etc/dansguardian/lists/blacklists/ossi/urls
1079
	touch /etc/dansguardian/lists/blacklists/ossi/urls
1098
# On crée les fichiers vides de sites ou d'URL réhabilités
1080
# On crée les fichiers vides de sites ou d'URL réhabilités
1099
	[ -e /etc/dansguardian/lists/exceptionsitelist.default ] || mv /etc/dansguardian/lists/exceptionsitelist  /etc/dansguardian/lists/exceptionsitelist.default
1081
	[ -e /etc/dansguardian/lists/exceptionsitelist.default ] || mv /etc/dansguardian/lists/exceptionsitelist  /etc/dansguardian/lists/exceptionsitelist.default
1100
	[ -e /etc/dansguardian/lists/exceptionurllist.default ] || mv /etc/dansguardian/lists/exceptionurllist  /etc/dansguardian/lists/exceptionurllist.default
1082
	[ -e /etc/dansguardian/lists/exceptionurllist.default ] || mv /etc/dansguardian/lists/exceptionurllist  /etc/dansguardian/lists/exceptionurllist.default
1101
	touch /etc/dansguardian/lists/exceptionsitelist
1083
	touch /etc/dansguardian/lists/exceptionsitelist
-
 
1084
	touch /etc/dansguardian/lists/exceptionurllist
1102
# On crée la configuration de base du filtrage de domaine et d'URL pour Dansguardian
1085
# On crée la configuration de base du filtrage de domaine et d'URL pour Dansguardian
1103
	cat <<EOF > /etc/dansguardian/lists/bannedurllist
1086
	cat <<EOF > /etc/dansguardian/lists/bannedurllist
1104
# Dansguardian filter config for ALCASAR
1087
# Dansguardian filter config for ALCASAR
1105
EOF
1088
EOF
1106
	cat <<EOF > /etc/dansguardian/lists/bannedsitelist
1089
	cat <<EOF > /etc/dansguardian/lists/bannedsitelist