Subversion Repositories ALCASAR

Rev

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

Rev 1350 Rev 1353
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 1350 2014-05-14 16:14:43Z richard $ 
2
#  $Id: alcasar.sh 1353 2014-05-19 16:59:51Z 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 393... Line 393...
393
EOF
393
EOF
394
# config /etc/hosts
394
# config /etc/hosts
395
	[ -e /etc/hosts.default ] || cp /etc/hosts /etc/hosts.default
395
	[ -e /etc/hosts.default ] || cp /etc/hosts /etc/hosts.default
396
	cat <<EOF > /etc/hosts
396
	cat <<EOF > /etc/hosts
397
127.0.0.1	localhost
397
127.0.0.1	localhost
398
$PRIVATE_IP	$HOSTNAME.$DOMAIN $HOSTNAME $ORGANISME $ORGANISME.$DOMAIN
398
$PRIVATE_IP	$HOSTNAME.$DOMAIN $HOSTNAME $ORGANISME.$DOMAIN $ORGANISME
399
EOF
399
EOF
400
# Config EXTIF (Internet)
400
# Config EXTIF (Internet)
401
	cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-$EXTIF
401
	cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-$EXTIF
402
DEVICE=$EXTIF
402
DEVICE=$EXTIF
403
BOOTPROTO=static
403
BOOTPROTO=static
Line 701... Line 701...
701
	mkdir -p /var/lib/mysql/.tmp
701
	mkdir -p /var/lib/mysql/.tmp
702
	chown -R mysql:mysql /var/lib/mysql/
702
	chown -R mysql:mysql /var/lib/mysql/
703
	[ -e /etc/my.cnf.rpmnew ] && mv /etc/my.cnf.rpmnew /etc/my.cnf		# prend en compte les migrations de MySQL
703
	[ -e /etc/my.cnf.rpmnew ] && mv /etc/my.cnf.rpmnew /etc/my.cnf		# prend en compte les migrations de MySQL
704
	[ -e /etc/my.cnf.default ] || cp /etc/my.cnf /etc/my.cnf.default
704
	[ -e /etc/my.cnf.default ] || cp /etc/my.cnf /etc/my.cnf.default
705
	$SED "s?^#bind-address.*?bind-address=127.0.0.1?g" /etc/my.cnf
705
	$SED "s?^#bind-address.*?bind-address=127.0.0.1?g" /etc/my.cnf
706
	/etc/init.d/mysqld start
706
	systemctl start mysqld.service
707
	sleep 4
707
	sleep 4
708
	mysqladmin -u root password $mysqlpwd
708
	mysqladmin -u root password $mysqlpwd
709
	MYSQL="/usr/bin/mysql -uroot -p$mysqlpwd --exec"
709
	MYSQL="/usr/bin/mysql -uroot -p$mysqlpwd --exec"
710
# Delete exemple databases if exist
710
# Delete exemple databases if exist
711
	$MYSQL="DROP DATABASE IF EXISTS test;DROP DATABASE IF EXISTS tmp;CONNECT mysql;DELETE from user where user='';FLUSH PRIVILEGES;" 
711
	$MYSQL="DROP DATABASE IF EXISTS test;DROP DATABASE IF EXISTS tmp;CONNECT mysql;DELETE from user where user='';FLUSH PRIVILEGES;" 
Line 1477... Line 1477...
1477
 
1477
 
1478
[Install]
1478
[Install]
1479
WantedBy=multi-user.target
1479
WantedBy=multi-user.target
1480
EOF
1480
EOF
1481
# processes launched at boot time (SYSV)
1481
# processes launched at boot time (SYSV)
1482
	for i in ntpd iptables ulogd dnsmasq chilli httpd radiusd netfs mysqld dansguardian havp freshclam
1482
	for i in ntpd iptables ulogd dnsmasq chilli httpd radiusd netfs dansguardian havp freshclam
1483
	do
1483
	do
1484
		/sbin/chkconfig --add $i
1484
		/sbin/chkconfig --add $i
1485
	done
1485
	done
1486
# processes launched at boot time (Systemctl)
1486
# processes launched at boot time (Systemctl)
1487
	for i in alcasar-load_balancing.service nfsen.service
1487
	for i in alcasar-load_balancing.service nfsen.service mysqld.service
1488
 
1488
 
1489
	do
1489
	do
1490
		systemctl enable $i
1490
		systemctl enable $i
1491
	done
1491
	done
1492
# Apply French Security Agency (ANSSI) rules
1492
# Apply French Security Agency (ANSSI) rules