diff --git a/scripts/remove b/scripts/remove new file mode 100644 index 0000000..935a16b --- /dev/null +++ b/scripts/remove @@ -0,0 +1,34 @@ +#!/bin/bash + +# Exit on command errors and treat unset variables as an error +set -u + +# Source app helpers +source _common.sh +source /usr/share/yunohost/helpers + +app=$YNH_APP_INSTANCE_NAME + +# Retrieve app settings +domain=$(ynh_app_setting_get $app domain) + +# Stop and remove service +ynh_remove_systemd_config + +# Remove logrotate configuration +ynh_remove_logrotate + +# Remove sources +ynh_secure_remove "/var/www/$app" + +# Remove nginx configuration file +ynh_remove_nginx_config + +# Remove user and data +ynh_system_user_delete $app + +# Remove monitor +sudo yunohost service remove $app + +# Remove Nodejs +ynh_remove_nodejs