mirror of
https://github.com/YunoHost-Apps/cryptpad_ynh.git
synced 2024-09-03 18:26:14 +02:00
Update remove
This commit is contained in:
parent
8dbf86e830
commit
917356368f
1 changed files with 52 additions and 17 deletions
|
@ -1,34 +1,69 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Exit on command errors and treat unset variables as an error
|
#=================================================
|
||||||
set -u
|
# GENERIC STARTING
|
||||||
|
#=================================================
|
||||||
|
# IMPORT GENERIC HELPERS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
# Source app helpers
|
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# LOAD SETTINGS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
app=$YNH_APP_INSTANCE_NAME
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
# Retrieve app settings
|
# Retrieve app settings
|
||||||
domain=$(ynh_app_setting_get $app domain)
|
domain=$(ynh_app_setting_get $app domain)
|
||||||
|
|
||||||
# Stop and remove service
|
#=================================================
|
||||||
|
# STANDARD REMOVE
|
||||||
|
#=================================================
|
||||||
|
# STOP AND REMOVE SERVICE
|
||||||
|
#=================================================
|
||||||
|
|
||||||
ynh_remove_systemd_config
|
ynh_remove_systemd_config
|
||||||
|
|
||||||
# Remove logrotate configuration
|
#=================================================
|
||||||
ynh_remove_logrotate
|
# DISABLE SERVICE IN ADMIN PANEL
|
||||||
|
#=================================================
|
||||||
|
|
||||||
# Remove sources
|
if yunohost service status | grep -q $app # Check if service is declared in YunoHost
|
||||||
ynh_secure_remove "/var/www/$app"
|
then
|
||||||
|
ynh_print_info "Remove $app service" >&2
|
||||||
|
yunohost service remove $app
|
||||||
|
fi
|
||||||
|
|
||||||
# Remove nginx configuration file
|
#=================================================
|
||||||
ynh_remove_nginx_config
|
# REMOVE NODEJS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
# Remove user and data
|
|
||||||
ynh_system_user_delete $app
|
|
||||||
|
|
||||||
# Remove monitor
|
|
||||||
sudo yunohost service remove $app
|
|
||||||
|
|
||||||
# Remove Nodejs
|
|
||||||
ynh_remove_nodejs
|
ynh_remove_nodejs
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# REMOVE THE MAIN DIR OF THE APP
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_secure_remove "/var/www/$app" # Remove the app directory securely
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# REMOVE THE NGINX CONFIGURATION
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_remove_nginx_config # Remove the dedicated nginx config
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# REMOVE THE LOGROTATE CONFIG
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_remove_logrotate # Remove the app-specific logrotate config
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# GENERIC FINALIZATION
|
||||||
|
#=================================================
|
||||||
|
# REMOVE DEDICATED USER
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
ynh_system_user_delete $app
|
||||||
|
|
Loading…
Add table
Reference in a new issue