1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/rocketchat_ynh.git synced 2024-09-03 20:16:25 +02:00
rocketchat_ynh/scripts/remove

36 lines
865 B
Text
Raw Normal View History

2016-04-29 16:32:48 +02:00
#!/bin/bash
2017-07-18 13:21:17 +02:00
set -u
2016-04-29 16:32:48 +02:00
2017-07-18 13:03:45 +02:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source ./_common.sh
2017-07-18 13:03:45 +02:00
source /usr/share/yunohost/helpers
2017-07-18 13:21:17 +02:00
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
2017-07-21 10:54:41 +02:00
final_path=$(ynh_app_setting_get $app final_path)
2017-07-21 11:43:20 +02:00
serviceuser=$(ynh_app_setting_get $app serviceuser)
2016-04-29 16:32:48 +02:00
2017-07-21 10:54:41 +02:00
sudo systemctl stop $app.service
2016-04-29 16:32:48 +02:00
2017-07-19 13:32:24 +02:00
# remove Rocketchat from services
2017-07-21 10:54:41 +02:00
sudo yunohost service remove $app
2017-07-19 13:32:24 +02:00
2017-07-21 10:54:41 +02:00
sudo rm -rf $final_path
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
sudo rm -rf /var/log/$app
sudo rm -f /etc/systemd/system/$app.service
# remove database!!!
sudo mongo rocketchat --eval "db.dropDatabase()"
# remove user!!!
2017-07-21 11:43:20 +02:00
sudo userdel -r $serviceuser
2017-07-19 11:13:17 +02:00
2017-07-19 11:27:56 +02:00
sudo systemctl daemon-reload
2017-07-21 10:54:41 +02:00
sudo systemctl reload nginx