| Line 1... |
Line 1... |
| 1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
| 2 |
# $Id: alcasar.sh 1961 2016-06-23 21:23:34Z richard $
|
2 |
# $Id: alcasar.sh 1963 2016-06-24 22:38:53Z 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 934... |
Line 934... |
| 934 |
rm -rf /var/lib/mysql # to be sure that there is no former installation
|
934 |
rm -rf /var/lib/mysql # to be sure that there is no former installation
|
| 935 |
[ -e /etc/my.cnf.default ] || cp /etc/my.cnf /etc/my.cnf.default
|
935 |
[ -e /etc/my.cnf.default ] || cp /etc/my.cnf /etc/my.cnf.default
|
| 936 |
$SED "s?^#bind-address.*?bind-address=127.0.0.1?g" /etc/my.cnf
|
936 |
$SED "s?^#bind-address.*?bind-address=127.0.0.1?g" /etc/my.cnf
|
| 937 |
$SED "s?^tmpdir.*?tmpdir=/tmp?g" /etc/my.cnf
|
937 |
$SED "s?^tmpdir.*?tmpdir=/tmp?g" /etc/my.cnf
|
| 938 |
/usr/bin/systemctl start mysqld.service
|
938 |
/usr/bin/systemctl start mysqld.service
|
| - |
|
939 |
nb_round=1
|
| - |
|
940 |
while [ ! -f /var/run/mysqld/mysqld.pid ] && [ $nb_round -ne 10 ] # we wait until mariadb is on
|
| - |
|
941 |
do
|
| - |
|
942 |
nb_round=`expr $nb_round + 1`
|
| 939 |
sleep 4
|
943 |
sleep 2
|
| 940 |
is_active=`systemctl is-active mysqld`
|
944 |
done
|
| 941 |
if [ "$is_active" != "active" ]
|
945 |
if [ ! -f /var/run/mysqld/mysqld.pid ]
|
| 942 |
then
|
946 |
then
|
| 943 |
sleep 4 # we need to wait again (slow machine)
|
947 |
echo "Problème : la base donnée ne s'est pas lancée ! "
|
| - |
|
948 |
exit
|
| 944 |
fi
|
949 |
fi
|
| 945 |
mysqladmin -u root password $mysqlpwd
|
950 |
mysqladmin -u root password $mysqlpwd
|
| 946 |
MYSQL="/usr/bin/mysql -uroot -p$mysqlpwd --exec"
|
951 |
MYSQL="/usr/bin/mysql -uroot -p$mysqlpwd --exec"
|
| 947 |
# Secure the server
|
952 |
# Secure the server
|
| 948 |
$MYSQL="DROP DATABASE IF EXISTS test;DROP DATABASE IF EXISTS tmp;"
|
953 |
$MYSQL="DROP DATABASE IF EXISTS test;DROP DATABASE IF EXISTS tmp;"
|