1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/coin_ynh.git synced 2024-09-03 18:16:26 +02:00
coin_ynh/scripts/common.sh

21 lines
703 B
Bash
Raw Normal View History

2017-04-09 11:05:39 +02:00
function install_dependencies()
{
# Dependencies
2017-08-02 16:26:44 +02:00
ynh_install_app_dependencies gunicorn python-dev python-pip libldap2-dev libpq-dev libsasl2-dev libjpeg-dev libxml2-dev libxslt1-dev libffi-dev python-cairo libpango1.0-0 postgresql postgresql-contrib #libmysqlclient-dev
2017-04-09 11:05:39 +02:00
}
2017-08-02 16:26:44 +02:00
function init_db()
{
sed -i '/local\s*all\s*all\s*peer/i \
local all coin password' /etc/postgresql/9.*/main/pg_hba.conf
2017-08-02 16:26:44 +02:00
service postgresql reload
# Generate random password
db_name=$app
db_user=$app
db_pwd=$(ynh_string_random)
# Initialize database and store pssql password for upgrade
ynh_psql_create_db $db_name $db_user $db_pwd
ynh_app_setting_set "$app" psqlpassword "$db_pwd"
}