mirror of
https://github.com/YunoHost-Apps/yunorunner_ynh.git
synced 2024-09-03 20:36:13 +02:00
73 lines
2 KiB
Bash
Executable file
73 lines
2 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
#=================================================
|
|
# 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)
|
|
port=$(ynh_app_setting_get $app port)
|
|
|
|
#=================================================
|
|
# STANDARD REMOVE
|
|
#=================================================
|
|
# STOP AND REMOVE SERVICE
|
|
#=================================================
|
|
|
|
ynh_remove_systemd_config
|
|
|
|
#=================================================
|
|
# DISABLE SERVICE IN ADMIN PANEL
|
|
#=================================================
|
|
|
|
if yunohost service status | grep -q $app # Test l'existence du service dans Yunohost
|
|
then
|
|
ynh_print_info "Remove $app service" >&2
|
|
yunohost service remove $app.service
|
|
fi
|
|
|
|
#=================================================
|
|
# REMOVE DEPENDENCIES
|
|
#=================================================
|
|
|
|
ynh_remove_app_dependencies
|
|
|
|
#=================================================
|
|
# REMOVE THE MAIN DIR OF THE APP
|
|
#=================================================
|
|
|
|
ynh_secure_remove "/var/www/$app" # Suppression du dossier de l'application
|
|
|
|
#=================================================
|
|
# REMOVE THE NGINX CONFIGURATION
|
|
#=================================================
|
|
|
|
ynh_remove_nginx_config # Suppression de la configuration nginx
|
|
|
|
#=================================================
|
|
# CLOSE A PORT
|
|
#=================================================
|
|
|
|
if yunohost firewall list | grep -q "\- $port$"
|
|
then
|
|
ynh_print_info "Close port $port" >&2
|
|
ynh_exec_quiet yunohost firewall disallow TCP $port
|
|
fi
|
|
|
|
#=================================================
|
|
# GENERIC FINALISATION
|
|
#=================================================
|
|
# REMOVE DEDICATED USER
|
|
#=================================================
|
|
|
|
ynh_system_user_delete $app
|