mirror of
https://github.com/YunoHost-Apps/cryptpad_ynh.git
synced 2024-09-03 18:26:14 +02:00
75 lines
2.1 KiB
Bash
75 lines
2.1 KiB
Bash
#!/bin/bash
|
|
|
|
#=================================================
|
|
# GENERIC STARTING
|
|
#=================================================
|
|
# IMPORT GENERIC HELPERS
|
|
#=================================================
|
|
|
|
source _common.sh
|
|
source /usr/share/yunohost/helpers
|
|
|
|
#=================================================
|
|
# LOAD SETTINGS
|
|
#=================================================
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
port=$(ynh_app_setting_get $app port)
|
|
# Retrieve app settings
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
final_path=$(ynh_app_setting_get $app final_path)
|
|
|
|
#=================================================
|
|
# STANDARD REMOVE
|
|
#=================================================
|
|
# STOP AND REMOVE SERVICE
|
|
#=================================================
|
|
|
|
# Remove the dedicated systemd config
|
|
ynh_remove_systemd_config
|
|
|
|
#=================================================
|
|
# REMOVE SERVICE FROM ADMIN PANEL
|
|
#=================================================
|
|
|
|
# Remove a service from the admin panel, added by `yunohost service add`
|
|
if yunohost service status | grep -q $app
|
|
then
|
|
echo "Remove $app service"
|
|
yunohost service remove $app
|
|
fi
|
|
|
|
#=================================================
|
|
# REMOVE NODEJS
|
|
#=================================================
|
|
|
|
ynh_remove_nodejs
|
|
|
|
#=================================================
|
|
# REMOVE APP MAIN DIR
|
|
#=================================================
|
|
|
|
# Remove the app directory securely
|
|
ynh_secure_remove "$final_path"
|
|
|
|
#=================================================
|
|
# REMOVE NGINX CONFIGURATION
|
|
#=================================================
|
|
|
|
# Remove the dedicated nginx config
|
|
ynh_remove_nginx_config
|
|
|
|
#=================================================
|
|
# REMOVE THE LOGROTATE CONFIG
|
|
#=================================================
|
|
|
|
ynh_remove_logrotate # Remove the app-specific logrotate config
|
|
ynh_secure_remove "/var/log/$app/"
|
|
|
|
#=================================================
|
|
# GENERIC FINALIZATION
|
|
#=================================================
|
|
# REMOVE DEDICATED USER
|
|
#=================================================
|
|
|
|
ynh_system_user_delete $app
|