2016-10-25 00:00:01 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2016-10-25 23:34:42 +02:00
|
|
|
# Exit on command errors and treat unset variables as an error
|
|
|
|
set -eu
|
2016-10-25 00:00:01 +02:00
|
|
|
|
2016-10-25 23:34:42 +02:00
|
|
|
# Load common variables and functions
|
|
|
|
source ./_common.sh
|
2016-10-25 00:00:01 +02:00
|
|
|
|
|
|
|
# Retrieve app settings
|
|
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
|
|
|
|
|
|
|
# Stop haste
|
|
|
|
sudo systemctl stop "$app".service
|
|
|
|
|
|
|
|
# Remove sources
|
|
|
|
sudo rm -rf "/opt/"${app}
|
|
|
|
|
|
|
|
# Remove nginx configuration file
|
|
|
|
[[ -n $domain ]] && sudo rm -f "/etc/nginx/conf.d/${domain}.d/${app}.conf"
|
|
|
|
|
|
|
|
# Remove haste user and data
|
|
|
|
sudo userdel -r "$app"
|
|
|
|
|
|
|
|
# Remove init script
|
|
|
|
sudo systemctl disable "$app".service
|
|
|
|
sudo rm -f /etc/systemd/system/"$app".service
|
|
|
|
sudo systemctl daemon-reload
|
|
|
|
|
|
|
|
# Remove monitor
|
|
|
|
sudo yunohost service remove "$app"
|
|
|
|
|
|
|
|
# Reload nginx service
|
|
|
|
sudo systemctl reload nginx.service
|