mirror of
https://github.com/YunoHost-Apps/osada_ynh.git
synced 2024-09-03 19:46:30 +02:00
Fix database
This commit is contained in:
parent
91ff379d46
commit
d02448dde6
2 changed files with 3 additions and 11 deletions
|
@ -93,8 +93,6 @@ elif [ $database = "postgresql" ]; then
|
|||
ynh_psql_test_if_first_run
|
||||
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name
|
||||
db_type=1
|
||||
else
|
||||
ynh_die --message="Some problem occured in creating the database, contact maintainer"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
@ -143,8 +141,6 @@ if [ $database = "mysql" ]; then
|
|||
ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" < $final_path/install/schema_mysql.sql
|
||||
elif [ $database = "postgresql" ]; then
|
||||
ynh_psql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" < $final_path/install/schema_postgres.sql
|
||||
else
|
||||
ynh_die --message="Some problem occured in creating the database, contact maintainer"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -18,8 +18,8 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
admin=$(ynh_app_setting_get --app=$app --key=admin)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
db_user=$db_name
|
||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||
|
@ -77,14 +77,12 @@ if ynh_legacy_permissions_exists; then
|
|||
fi
|
||||
|
||||
# Switch $database to "mysql" or "postgresql"
|
||||
if [ $database = "1" ] 2>/dev/null; then
|
||||
if [[ $database == "1" ]] 2>/dev/null; then
|
||||
database="mysql"
|
||||
ynh_app_setting_set --app=$app --key=database --value=$database
|
||||
elif [ $database = "2" ] 2>/dev/null; then
|
||||
elif [[ $database == "2" ]] 2>/dev/null; then
|
||||
database="postgresql"
|
||||
ynh_app_setting_set --app=$app --key=database --value=$database
|
||||
else
|
||||
ynh_die --message="Some problem occured in creating the database, contact maintainer"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
@ -154,8 +152,6 @@ if [ $database = "mysql" ]; then
|
|||
elif [ $database = "postgresql" ]; then
|
||||
db_type=1
|
||||
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
||||
else
|
||||
ynh_die --message="Some problem occured in creating the database, contact maintainer"
|
||||
fi
|
||||
|
||||
ynh_add_config --template="../conf/htconfig.sample.php" --destination="$final_path/.htconfig.php"
|
||||
|
|
Loading…
Add table
Reference in a new issue