diff --git a/scripts/install b/scripts/install index 1431fbe..4b8263f 100755 --- a/scripts/install +++ b/scripts/install @@ -74,12 +74,12 @@ ynh_system_user_create --username=$app --home_dir="$final_path" #================================================= # CREATE A MYSQL DATABASE #================================================= -# ynh_script_progression --message="Creating a MySQL database..." --weight=2 +ynh_script_progression --message="Creating a MySQL database..." --weight=2 -# db_name=$(ynh_sanitize_dbid --db_name=$app) -# db_user=$db_name -# ynh_app_setting_set --app=$app --key=db_name --value=$db_name -# ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name +db_name=$(ynh_sanitize_dbid --db_name=$app) +db_user=$db_name +ynh_app_setting_set --app=$app --key=db_name --value=$db_name +ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -158,7 +158,7 @@ yunohost service add $app --description="Simple bookmark manager" --log="/var/lo ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # SETUP SSOWAT diff --git a/scripts/remove b/scripts/remove index a5f7b75..c4cb93c 100755 --- a/scripts/remove +++ b/scripts/remove @@ -18,8 +18,8 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) port=$(ynh_app_setting_get --app=$app --key=port) -#db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#db_user=$db_name +db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= @@ -54,10 +54,10 @@ ynh_remove_logrotate #================================================= # REMOVE THE MYSQL DATABASE #================================================= -# ynh_script_progression --message="Removing the MySQL database..." --weight=1 +ynh_script_progression --message="Removing the MySQL database..." --weight=1 -# # Remove a database if it exists, along with the associated user -# ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name +# Remove a database if it exists, along with the associated user +ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name #================================================= # REMOVE DEPENDENCIES diff --git a/scripts/restore b/scripts/restore index 38bf6e9..c3bf040 100755 --- a/scripts/restore +++ b/scripts/restore @@ -31,8 +31,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) -#db_name=$(ynh_app_setting_get --app=$app --key=db_name) -#db_user=$db_name +db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_user=$db_name datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= @@ -96,11 +96,11 @@ ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE MYSQL DATABASE #================================================= -# ynh_script_progression --message="Restoring the MySQL database..." --weight=1 +ynh_script_progression --message="Restoring the MySQL database..." --weight=1 -# db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -# ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd -# ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql +db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) +ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd +ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql #================================================= # RESTORE SYSTEMD @@ -129,7 +129,7 @@ yunohost service add $app --description="Simple bookmark manager" --log="/var/lo #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 7fff4b0..b9e1b13 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -19,7 +19,7 @@ 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) -#db_name=$(ynh_app_setting_get --app=$app --key=db_name) +db_name=$(ynh_app_setting_get --app=$app --key=db_name) #================================================= # CHECK VERSION @@ -119,7 +119,7 @@ yunohost service add $app --description="Simple bookmark manager" --log="/var/lo #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # RELOAD NGINX