From 4819154e5947787eac02981155b36e6b82784525 Mon Sep 17 00:00:00 2001 From: farvardin Date: Sun, 1 Mar 2020 11:55:13 +0100 Subject: [PATCH] fix --- conf/local.conf | 0 scripts/backup | 32 +--------------------------- scripts/remove | 55 +------------------------------------------------ 3 files changed, 2 insertions(+), 85 deletions(-) delete mode 100644 conf/local.conf diff --git a/conf/local.conf b/conf/local.conf deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/backup b/scripts/backup index d985aba..a532136 100644 --- a/scripts/backup +++ b/scripts/backup @@ -65,9 +65,7 @@ ynh_backup --src_path="/etc/php/7.0/fpm/pool.d/$app.conf" #================================================= # BACKUP THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Backing up the MySQL database..." --time --weight=1 - -ynh_mysql_dump_db --database="$db_name" > db.sql +# no sql #================================================= # BACKUP FAIL2BAN CONFIGURATION @@ -77,34 +75,6 @@ ynh_script_progression --message="Backing up fail2ban configuration..." --time - ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" -#================================================= -# SPECIFIC BACKUP -#================================================= -# BACKUP LOGROTATE -#================================================= -ynh_script_progression --message="Backing up logrotate configuration..." --time --weight=1 - -ynh_backup --src_path="/etc/logrotate.d/$app" - -#================================================= -# BACKUP SYSTEMD -#================================================= -ynh_script_progression --message="Backing up systemd configuration..." --time --weight=1 - -ynh_backup --src_path="/etc/systemd/system/$app.service" - -#================================================= -# BACKUP A CRON FILE -#================================================= - -ynh_backup --src_path="/etc/cron.d/$app" - -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 - -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 1fc81f3..db74917 100644 --- a/scripts/remove +++ b/scripts/remove @@ -25,39 +25,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= # STANDARD REMOVE #================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST -#================================================= - -# Remove the service from the list of services known by Yunohost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status $app >/dev/null -then - ynh_script_progression --message="Removing $app service..." --time --weight=1 - yunohost service remove $app -fi - -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --time --weight=1 - -# Remove the dedicated systemd config -ynh_remove_systemd_config - -#================================================= -# REMOVE THE MYSQL DATABASE -#================================================= -ynh_script_progression --message="Removing the MySQL database..." --time --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 DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." --time --weight=1 - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies + #================================================= # REMOVE APP MAIN DIR @@ -83,13 +51,6 @@ ynh_script_progression --message="Removing php-fpm configuration..." --time --we # Remove the dedicated php-fpm config ynh_remove_fpm_config -#================================================= -# REMOVE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." --time --weight=1 - -# Remove the app-specific logrotate config -ynh_remove_logrotate #================================================= # CLOSE A PORT @@ -109,22 +70,8 @@ ynh_script_progression --message="Removing fail2ban configuration..." --time --w # Remove the dedicated fail2ban config ynh_remove_fail2ban_config -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE THE CRON FILE #================================================= -# Remove a cron file -ynh_secure_remove --file="/etc/cron.d/$app" - -# Remove a directory securely -ynh_secure_remove --file="/etc/$app/" - -# Remove the log files -ynh_secure_remove --file="/var/log/$app/" - -#================================================= # GENERIC FINALIZATION #================================================= # REMOVE DEDICATED USER