Subversion Repositories ALCASAR

Rev

Rev 613 | Rev 618 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log

Rev 613 Rev 615
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
#  $Id: alcasar.sh 613 2011-05-23 22:02:37Z richard $ 
2
#  $Id: alcasar.sh 615 2011-05-24 21:47:25Z 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 671... Line 671...
671
	$SED "s?^#bind-address.*?bind-address=127.0.0.1?g" /etc/my.cnf
671
	$SED "s?^#bind-address.*?bind-address=127.0.0.1?g" /etc/my.cnf
672
	/etc/init.d/mysqld start
672
	/etc/init.d/mysqld start
673
	sleep 4
673
	sleep 4
674
	mysqladmin -u root password $mysqlpwd
674
	mysqladmin -u root password $mysqlpwd
675
	MYSQL="/usr/bin/mysql -uroot -p$mysqlpwd --exec"
675
	MYSQL="/usr/bin/mysql -uroot -p$mysqlpwd --exec"
676
# On supprime les tables d'exemple
676
# Delete exemple databases if exist
677
	$MYSQL="DROP DATABASE IF EXISTS test;DROP DATABASE IF EXISTS tmp;CONNECT mysql;DELETE from user where user='';FLUSH PRIVILEGES;" 
677
	$MYSQL="DROP DATABASE IF EXISTS test;DROP DATABASE IF EXISTS tmp;CONNECT mysql;DELETE from user where user='';FLUSH PRIVILEGES;" 
678
	# On crée la base 'radius'
678
# Create 'radius' database
679
	$MYSQL="CREATE DATABASE IF NOT EXISTS $DB_RADIUS;GRANT ALL ON $DB_RADIUS.* TO $DB_USER@localhost IDENTIFIED BY '$radiuspwd';FLUSH PRIVILEGES"
679
	$MYSQL="CREATE DATABASE IF NOT EXISTS $DB_RADIUS;GRANT ALL ON $DB_RADIUS.* TO $DB_USER@localhost IDENTIFIED BY '$radiuspwd';FLUSH PRIVILEGES"
680
# Ajout d'une base vierge	
680
# Add an empty radius database structure
681
	mysql -u$DB_USER -p$radiuspwd $DB_RADIUS < $DIR_CONF/radiusd-db-vierge.sql
681
	mysql -u$DB_USER -p$radiuspwd $DB_RADIUS < $DIR_CONF/radiusd-db-vierge.sql
-
 
682
# modify the start script in order to close accounting connexion when the system is comming down or up
-
 
683
	[ -e /etc/init.d/mysqld.default ] || cp /etc/init.d/mysqld /etc/init.d/mysqld.default
-
 
684
	$SED "/wait_for_pid created/a echo \"Flush ALCASAR open accounting sessions\"; /usr/local/sbin/alcasar-mysql.sh -acct_stop" /etc/init.d/mysqld
-
 
685
	$SED "/'stop')/a echo \"Flush ALCASAR open accounting sessions\"; /usr/local/sbin/alcasar-mysql.sh -acct_stop" /etc/init.d/mysqld
682
} # End init_db ()
686
} # End init_db ()
683
 
687
 
684
##########################################################################
688
##########################################################################
685
##			Fonction param_radius				##
689
##			Fonction param_radius				##
686
## - Paramètrage des fichiers de configuration FreeRadius		##
690
## - Paramètrage des fichiers de configuration FreeRadius		##
Line 1273... Line 1277...
1273
	$SED "/^ListenAddress $PRIVATE_IP/a\ListenAddress $PUBLIC_IP" /etc/ssh/sshd_config 
1277
	$SED "/^ListenAddress $PRIVATE_IP/a\ListenAddress $PUBLIC_IP" /etc/ssh/sshd_config 
1274
# Put the default value in conf file (sshd, QOS, protocols filter and dns filter are off)(web antivirus is on)
1278
# Put the default value in conf file (sshd, QOS, protocols filter and dns filter are off)(web antivirus is on)
1275
	/sbin/chkconfig --del sshd
1279
	/sbin/chkconfig --del sshd
1276
	echo "SSH=off" >> $FIC_CONF
1280
	echo "SSH=off" >> $FIC_CONF
1277
	echo "QOS=off" >> $FIC_CONF
1281
	echo "QOS=off" >> $FIC_CONF
-
 
1282
	echo "LDAP=off" >> $FIC_CONF
1278
	echo "PROTOCOLS_FILTERING=off" >> $FIC_CONF
1283
	echo "PROTOCOLS_FILTERING=off" >> $FIC_CONF
1279
	echo "DNS_FILTERING=off" >> $FIC_CONF
1284
	echo "DNS_FILTERING=off" >> $FIC_CONF
1280
	echo "WEB_ANTIVIRUS=on" >> $FIC_CONF
1285
	echo "WEB_ANTIVIRUS=on" >> $FIC_CONF
1281
# Coloration des prompts
1286
# Coloration des prompts
1282
	[ -e /etc/bashrc.default ]  || cp /etc/bashrc /etc/bashrc.default
1287
	[ -e /etc/bashrc.default ]  || cp /etc/bashrc /etc/bashrc.default