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,15 +40,6 @@
|
||||||
},
|
},
|
||||||
"choices": ["Yes", "No"],
|
"choices": ["Yes", "No"],
|
||||||
"default": "Yes"
|
"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
|
exit 1
|
||||||
fi
|
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
|
# 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 initdb $db_user -p $db_pwd -s $(readlink -e ../sources/SQL/mysql.initial.sql)
|
||||||
#sudo yunohost app setting rainloop mysqlpwd -v $db_pwd
|
sudo yunohost app initdb $db_user -p $db_pwd
|
||||||
|
sudo yunohost app setting $app mysqlpwd -v $db_pwd
|
||||||
#mysql -u $db_user -p$db_pwd $db_user < ../sources/plugins/automatic_addressbook/SQL/mysql.initial.sql
|
|
||||||
|
|
||||||
# Copy files to the right place
|
# Copy files to the right place
|
||||||
final_path=/var/www/$app
|
final_path=/var/www/$app
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#db_user=rainloop
|
|
||||||
#db_name=rainloop
|
|
||||||
#root_pwd=$(sudo cat /etc/yunohost/mysql)
|
|
||||||
app=phpBB
|
app=phpBB
|
||||||
|
|
||||||
|
db_user=$app
|
||||||
|
db_name=$app
|
||||||
|
root_pwd=$(sudo cat /etc/yunohost/mysql)
|
||||||
domain=$(sudo yunohost app setting $app domain)
|
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 -rf /var/www/$app
|
||||||
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
|
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
|
||||||
sudo rm -f /etc/php5/fpm/pool.d/$app.conf
|
sudo rm -f /etc/php5/fpm/pool.d/$app.conf
|
||||||
|
|
Loading…
Reference in a new issue