mirror of
https://github.com/YunoHost-Apps/piwigo_ynh.git
synced 2024-09-03 20:06:03 +02:00
829a1f16d9
Create and use ynh_add_fail2ban_config helper
62 lines
No EOL
1.6 KiB
Bash
62 lines
No EOL
1.6 KiB
Bash
#!/bin/bash
|
|
|
|
# Treat unset variables as an error
|
|
set -u
|
|
#=================================================
|
|
# GENERIC STARTING
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# LOAD SETTINGS
|
|
#=================================================
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
db_name=$(ynh_app_setting_get $app db_name)
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
|
|
|
#=================================================
|
|
# STANDARD REMOVE
|
|
#=================================================
|
|
|
|
#=================================================
|
|
# REMOVE THE MYSQL DB
|
|
#=================================================
|
|
|
|
ynh_mysql_remove_db "$app" "$db_name"
|
|
|
|
#=================================================
|
|
# REMOVE APP MAIN DIR
|
|
#=================================================
|
|
|
|
ynh_secure_remove "/var/www/$app"
|
|
ynh_secure_remove "/home/yunohost.app/$app"
|
|
|
|
#=================================================
|
|
# REMOVE FAIL2BAN CONFIGURATION
|
|
#=================================================
|
|
|
|
ynh_remove_fail2ban_config
|
|
|
|
#=================================================
|
|
# REMOVE NGINX AND PHP-FPM CONFIGURATION
|
|
#=================================================
|
|
|
|
ynh_remove_fpm_config
|
|
ynh_remove_nginx_config
|
|
|
|
# Reload services
|
|
sudo systemctl restart php5-fpm
|
|
sudo systemctl reload nginx
|
|
|
|
#=================================================
|
|
# REMOVE DEDICATED USER
|
|
#=================================================
|
|
|
|
ynh_system_user_delete $app |