2017-02-02 20:25:21 +01:00
|
|
|
#!/bin/bash
|
2017-04-21 12:54:39 +02:00
|
|
|
# vim:set noexpandtab:
|
2017-02-02 20:25:21 +01:00
|
|
|
|
2017-04-21 12:54:39 +02:00
|
|
|
# Exit on command errors and treat unset variables as an error
|
|
|
|
set -u
|
2017-02-02 20:25:21 +01:00
|
|
|
|
2017-04-21 12:54:39 +02:00
|
|
|
source .fonctions # Loads the generic functions usually used in the script
|
|
|
|
source /usr/share/yunohost/helpers # Source app helpers
|
2017-02-02 20:25:21 +01:00
|
|
|
|
2017-04-21 12:54:39 +02:00
|
|
|
# Get multi-instances specific variables
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
2017-02-02 20:25:21 +01:00
|
|
|
|
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
|
|
|
2017-04-21 12:54:39 +02:00
|
|
|
# Stop lstu service
|
2017-02-02 20:25:21 +01:00
|
|
|
if [ -e "/etc/systemd/system/lstu.service" ]; then
|
|
|
|
echo "Delete systemd script"
|
2017-04-21 12:54:39 +02:00
|
|
|
sudo systemctl stop lstu.service
|
2017-02-02 20:25:21 +01:00
|
|
|
sudo systemctl disable lstu.service
|
2017-04-21 12:54:39 +02:00
|
|
|
sudo rm "/etc/systemd/system/lstu.service"
|
|
|
|
systemctl daemon-reload
|
2017-02-02 20:25:21 +01:00
|
|
|
fi
|
|
|
|
|
2017-04-21 12:54:39 +02:00
|
|
|
# Remove monitoring service Yunohost.
|
|
|
|
if sudo yunohost service status | grep -q lstu # Test the existence of the service in Yunohost
|
2017-02-02 20:25:21 +01:00
|
|
|
then
|
|
|
|
echo "Remove lstu service"
|
|
|
|
sudo yunohost service remove lstu
|
|
|
|
fi
|
|
|
|
|
2017-04-21 12:54:39 +02:00
|
|
|
SECURE_REMOVE '/var/www/$app' # Delete directory application
|
|
|
|
|
|
|
|
REMOVE_NGINX_CONF # Delete nginx configuration
|
|
|
|
|
2017-02-02 20:25:21 +01:00
|
|
|
|
2017-04-21 12:54:39 +02:00
|
|
|
SECURE_REMOVE '/var/log/$app/' # Delete log
|
2017-02-02 20:25:21 +01:00
|
|
|
|
2017-04-21 12:54:39 +02:00
|
|
|
REMOVE_LOGROTATE_CONF # Delete logrotate configuration
|
2017-02-02 20:25:21 +01:00
|
|
|
|
2017-04-21 12:54:39 +02:00
|
|
|
ynh_package_remove build-essential || echo "build-essential already uninstalled"
|
|
|
|
ynh_package_remove libssl-dev || echo "libssl-dev already uninstalled"
|
|
|
|
ynh_package_remove libpq-dev || echo "libpq-dev already uninstalled"
|
2017-02-02 20:25:21 +01:00
|
|
|
|
2017-04-21 12:54:39 +02:00
|
|
|
# Reload SSOwat configuration
|
2017-02-02 20:25:21 +01:00
|
|
|
sudo yunohost app ssowatconf
|
|
|
|
|
|
|
|
echo -e "\e[0m" # Restore normal color
|