mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
We have mariadb-server-10.1 now
This commit is contained in:
parent
7de61ce8ab
commit
2f0db53d8c
2 changed files with 8 additions and 16 deletions
|
@ -1,6 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
MYSQL_PKG="mariadb-server-10.1"
|
||||
|
||||
do_pre_regen() {
|
||||
pending_dir=$1
|
||||
|
@ -31,19 +32,14 @@ do_post_regen() {
|
|||
"applications, and is going to reset the MySQL root password." \
|
||||
"You can find this new password in /etc/yunohost/mysql." >&2
|
||||
|
||||
# retrieve MySQL package provider
|
||||
ynh_package_is_installed "mariadb-server-10.0" \
|
||||
&& mysql_pkg="mariadb-server-10.0" \
|
||||
|| mysql_pkg="mysql-server-5.5"
|
||||
|
||||
# set new password with debconf
|
||||
sudo debconf-set-selections << EOF
|
||||
$mysql_pkg mysql-server/root_password password $mysql_password
|
||||
$mysql_pkg mysql-server/root_password_again password $mysql_password
|
||||
$MYSQL_PKG mysql-server/root_password password $mysql_password
|
||||
$MYSQL_PKG mysql-server/root_password_again password $mysql_password
|
||||
EOF
|
||||
|
||||
# reconfigure Debian package
|
||||
sudo dpkg-reconfigure -freadline -u "$mysql_pkg" 2>&1
|
||||
sudo dpkg-reconfigure -freadline -u "$MYSQL_PKG" 2>&1
|
||||
else
|
||||
echo "It seems that you have already configured MySQL." \
|
||||
"YunoHost needs to have a root access to MySQL to runs its" \
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
backup_dir="$1/conf/ynh/mysql"
|
||||
MYSQL_PKG="mariadb-server-10.1"
|
||||
|
||||
# ensure that mysql is running
|
||||
service mysql status >/dev/null 2>&1 \
|
||||
|
@ -23,19 +24,14 @@ sudo mysqladmin -s -u root -p"$curr_pwd" password "$new_pwd" || {
|
|||
"applications, and is going to reset the MySQL root password." \
|
||||
"You can find this new password in /etc/yunohost/mysql." >&2
|
||||
|
||||
# retrieve MySQL package provider
|
||||
ynh_package_is_installed "mariadb-server-10.0" \
|
||||
&& mysql_pkg="mariadb-server-10.0" \
|
||||
|| mysql_pkg="mysql-server-5.5"
|
||||
|
||||
# set new password with debconf
|
||||
sudo debconf-set-selections << EOF
|
||||
$mysql_pkg mysql-server/root_password password $new_pwd
|
||||
$mysql_pkg mysql-server/root_password_again password $new_pwd
|
||||
$MYSQL_PKG mysql-server/root_password password $new_pwd
|
||||
$MYSQL_PKG mysql-server/root_password_again password $new_pwd
|
||||
EOF
|
||||
|
||||
# reconfigure Debian package
|
||||
sudo dpkg-reconfigure -freadline -u "$mysql_pkg" 2>&1
|
||||
sudo dpkg-reconfigure -freadline -u "$MYSQL_PKG" 2>&1
|
||||
}
|
||||
|
||||
# store new root password
|
||||
|
|
Loading…
Add table
Reference in a new issue