-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·32 lines (25 loc) · 891 Bytes
/
install.sh
File metadata and controls
executable file
·32 lines (25 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
if [ ! -f config/config.yml ]; then
cp config/config.yml.dist config/config.yml
fi
if [ ! -f composer.phar ]; then
curl -sS https://getcomposer.org/installer | php
fi
if [ ! -d vendor ]; then
php composer.phar install
else
php composer.phar update
fi
while true; do
read -p "Do you wish to create a MySQL backup user? " yn
case $yn in
[Yy]* )
PASSWORD=`date +%s | sha256sum | base64 | head -c 32 ; echo`
echo "You will now be asked for the root password for MySQL:"
cat setup/create_backup_user_mysql.sql | sed "s/IDENTIFIED BY 'backup'/IDENTIFIED BY '${PASSWORD}'/g" | mysql -u root -p;
echo "We created/tried to create backup@localhost with password ${PASSWORD}, please configure config/database.json."
break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done