mirror of
https://github.com/YunoHost-Apps/phpbb_ynh.git
synced 2024-09-03 19:56:36 +02:00
MySQL database creation
This commit is contained in:
parent
0a2c6752ad
commit
cff0afa56a
3 changed files with 10 additions and 18 deletions
|
@ -40,16 +40,7 @@
|
|||
},
|
||||
"choices": ["Yes", "No"],
|
||||
"default": "Yes"
|
||||
},
|
||||
{
|
||||
"name": "db_pwd",
|
||||
"type": "password",
|
||||
"ask": {
|
||||
"en": "Indicate a password fot phpBB's MySQL database",
|
||||
"fr": "Choisissez un mot de passe pour la base MySQL de phpBB"
|
||||
},
|
||||
"example": "strong_password"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,13 +15,13 @@ if [[ ! $? -eq 0 ]]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
#db_user=$app
|
||||
db_user=$app
|
||||
db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d '[A-Za-z0-9]' | sed -n 's/\(.\{24\}\).*/\1/p')
|
||||
|
||||
# Initialize database and store mysql password for upgrade
|
||||
#sudo yunohost app initdb $db_user -p $db_pwd -s $(readlink -e ../sources/SQL/mysql.initial.sql)
|
||||
#sudo yunohost app setting rainloop mysqlpwd -v $db_pwd
|
||||
|
||||
#mysql -u $db_user -p$db_pwd $db_user < ../sources/plugins/automatic_addressbook/SQL/mysql.initial.sql
|
||||
sudo yunohost app initdb $db_user -p $db_pwd
|
||||
sudo yunohost app setting $app mysqlpwd -v $db_pwd
|
||||
|
||||
# Copy files to the right place
|
||||
final_path=/var/www/$app
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
#db_user=rainloop
|
||||
#db_name=rainloop
|
||||
#root_pwd=$(sudo cat /etc/yunohost/mysql)
|
||||
app=phpBB
|
||||
|
||||
db_user=$app
|
||||
db_name=$app
|
||||
root_pwd=$(sudo cat /etc/yunohost/mysql)
|
||||
domain=$(sudo yunohost app setting $app domain)
|
||||
|
||||
#mysql -u root -p $root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user@localhost ;"
|
||||
sudo mysql -u root -p $root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user@localhost ;"
|
||||
sudo rm -rf /var/www/$app
|
||||
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
|
||||
sudo rm -f /etc/php5/fpm/pool.d/$app.conf
|
||||
|
|
Loading…
Reference in a new issue