1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/etherpad_ynh.git synced 2024-09-03 18:36:10 +02:00
etherpad_ynh/scripts/remove
Bachir Soussi Chiadmi 0a809aa274 fixed manifest typo
added source ynh helpers
replaced deprecated db_init etc
fixed remove script
replaced static folders with
2016-07-10 18:40:48 +02:00

28 lines
712 B
Bash

#!/bin/bash
# See comments in install script
app=$YNH_APP_INSTANCE_NAME
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# Retrieve app settings
domain=$(ynh_app_setting_get "$app" domain)
path=$(ynh_app_setting_get "$app" path)
db_user=$(ynh_app_setting_get "$app" db_user)
db_name=$(ynh_app_setting_get "$app" db_name)
db_pwd=$(ynh_app_setting_get "$app" db_pwd)
root_pwd=$(sudo cat /etc/yunohost/mysql)
mysql -u root -p$root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user@localhost ;"
sudo rm -rf /var/www/$app
rm -f /etc/nginx/conf.d/$domain.d/$app.conf
sudo service nginx reload
sudo rm -Rf /var/log/$app
sudo update-rc.d $app remove
sudo service $app stop
sudo rm /etc/init.d/$app