-
Notifications
You must be signed in to change notification settings - Fork 0
/
34-mysql
48 lines (36 loc) · 1.13 KB
/
34-mysql
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
set -e
force=$1
function safe_copy () {
if [[ "$force" == "True" ]]; then
sudo yunohost service safecopy \
-s mysql $1 $2 --force
else
sudo yunohost service safecopy \
-s mysql $1 $2
fi
}
cd /usr/share/yunohost/templates/mysql
#if [[ "$(safe_copy my.cnf /etc/mysql/my.cnf | tail -n1)" == "True" ]]; then
# sudo service mysql restart
#fi
safe_copy my.cnf /etc/mysql/my.cnf
ps awxuf
sudo apt-get -y --force-yes --no-install-recommends install strace
sudo strace service mysql restart
#if [ ! -f /etc/yunohost/mysql ]; then
# [[ $(/bin/ps aux | grep '[m]ysqld') == "0" ]] \
# && sudo service mysql start
# sudo openssl rand -out /etc/yunohost/mysql -base64 16
# sudo chmod 400 /etc/yunohost/mysql
# mysql --no-defaults --user=root --password=yunohost << EOF
#USE mysql;
#UPDATE user SET password=PASSWORD("$(sudo cat /etc/yunohost/mysql)") WHERE user='root';
#FLUSH PRIVILEGES;
#EOF
#sudo apt-get install strace
#sudo strace mysqladmin --user=root --password=yunohost --protocol=TCP password "$(sudo cat /etc/yunohost/mysql)"
#fi
ps awxuf
echo "We are here"
exit 0