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
Selamanse 3493b1fd52 Fixes backup and restore
Adds working upgrade
2017-07-26 08:51:04 +02:00

35 lines
865 B
Bash

#!/bin/bash
set -u
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source ./_common.sh
source /usr/share/yunohost/helpers
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get $app domain)
final_path=$(ynh_app_setting_get $app final_path)
serviceuser=$(ynh_app_setting_get $app serviceuser)
sudo systemctl stop $app.service
# remove Rocketchat from services
sudo yunohost service remove $app
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!!!
sudo userdel -r $serviceuser
sudo systemctl daemon-reload
sudo systemctl reload nginx