mirror of
https://github.com/YunoHost-Apps/dendrite_ynh.git
synced 2024-09-03 18:25:58 +02:00
Cleaning up
This commit is contained in:
parent
e99fff360c
commit
38eda7eb59
3 changed files with 5 additions and 18 deletions
|
@ -89,20 +89,13 @@ env_path=$PATH
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2
|
ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2
|
||||||
|
|
||||||
ynh_print_OFF
|
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||||
db_pwd=$(ynh_string_random --length=30)
|
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||||
ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd
|
|
||||||
ynh_print_ON
|
|
||||||
|
|
||||||
# Create postgresql database
|
|
||||||
ynh_psql_test_if_first_run
|
ynh_psql_test_if_first_run
|
||||||
db_name=$app
|
ynh_psql_setup_db --db_user=$db_name --db_name=$db_name
|
||||||
ynh_print_OFF
|
|
||||||
ynh_psql_create_user $db_name $db_pwd
|
|
||||||
ynh_print_ON
|
|
||||||
ynh_psql_execute_as_root \
|
ynh_psql_execute_as_root \
|
||||||
--sql="CREATE DATABASE $db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER $app;"
|
--sql="CREATE DATABASE $db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER $app;"
|
||||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
|
|
|
@ -86,12 +86,6 @@ ynh_remove_logrotate
|
||||||
# CLOSE A PORT
|
# CLOSE A PORT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
if yunohost firewall list | grep -q "\- $port$"
|
|
||||||
then
|
|
||||||
ynh_script_progression --message="Closing port $port..." --weight=1
|
|
||||||
ynh_exec_warn_less yunohost firewall disallow TCP $port
|
|
||||||
fi
|
|
||||||
|
|
||||||
if yunohost firewall list | grep -q "\- $tls_port$"
|
if yunohost firewall list | grep -q "\- $tls_port$"
|
||||||
then
|
then
|
||||||
ynh_script_progression --message="Closing port $tls_port..." --weight=1
|
ynh_script_progression --message="Closing port $tls_port..." --weight=1
|
||||||
|
|
|
@ -35,7 +35,7 @@ port=$(ynh_app_setting_get --app=$app --key=port)
|
||||||
tls_port=$(ynh_app_setting_get --app=$app --key=tls_port)
|
tls_port=$(ynh_app_setting_get --app=$app --key=tls_port)
|
||||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||||
db_user=$db_name
|
db_user=$db_name
|
||||||
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
|
db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CHECK IF THE APP CAN BE RESTORED
|
# CHECK IF THE APP CAN BE RESTORED
|
||||||
|
|
Loading…
Add table
Reference in a new issue