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

YunoHost 2.4

This commit is contained in:
Jeff 2016-06-28 17:29:32 +02:00 committed by GitHub
parent 3e7ebfb934
commit 5b8cd31494

View file

@ -1,18 +1,25 @@
#!/bin/bash # Exit on command errors and treat unset variables as an error
set -e set -eu
app=rainloop app=$YNH_APP_INSTANCE_NAME
db_user=$app # Source app helpers
db_name=$app . /usr/share/yunohost/helpers
root_pwd=$(sudo cat /etc/yunohost/mysql)
domain=$(sudo yunohost app setting $app domain)
mysql -u root -p$root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user@localhost ;" # Retrieve arguments
sudo rm -rf /var/www/$app dbuser=$app
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf dbname=$app
sudo rm -f /etc/php5/fpm/pool.d/$app.conf root_pwd=$(sudo cat /etc/yunohost/mysql)
domain=$(ynh_app_setting_get "$app" domain)
sudo service php5-fpm restart # Drop MySQL database and user
sudo service nginx reload ynh_mysql_drop_db "$dbname" 2>&1 || true
sudo yunohost app ssowatconf ynh_mysql_drop_user "$dbuser" 2>&1 || true
# Delete app directory and configurations
sudo rm -rf "/var/www/${app}"
sudo rm -f "/etc/php5/fpm/pool.d/${app}.conf"
[[ -n $domain ]] && sudo rm -f "/etc/nginx/conf.d/${domain}.d/${app}.conf"
# Reload services
sudo service php5-fpm restart || true
sudo service nginx reload || true