1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/duniter_ynh.git synced 2024-09-03 18:26:35 +02:00
duniter_ynh/scripts/remove
2017-02-21 14:52:50 +01:00

28 lines
579 B
Bash
Executable file

#!/bin/bash
# Exit and treat unset variables as an error
set -u
# Source app helpers
source /usr/share/yunohost/helpers
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
port=$(ynh_app_setting_get $app port)
# Remove Duniter
sudo $app stop
sudo dpkg -r $app
# Remove data and conf
sudo rm -rf /root/.conf/duniter
# Remove Duniter service to YunoHost monitoring
sudo yunohost service remove $app
# Remove proxy_pass
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
sudo service nginx reload
# Close opened port
sudo yunohost firewall disallow TCP $port