2014-07-20 14:09:41 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-10-19 12:13:47 +02:00
|
|
|
# Source local helpers
|
|
|
|
source ./_common.sh
|
|
|
|
|
|
|
|
# Source app helpers
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2017-10-19 12:31:32 +02:00
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
2014-07-20 14:09:41 +02:00
|
|
|
|
2016-07-23 14:54:26 +02:00
|
|
|
dbname=$app
|
|
|
|
dbuser=$app
|
2014-07-20 14:09:41 +02:00
|
|
|
|
2016-07-23 14:54:26 +02:00
|
|
|
# Drop MySQL database and user
|
|
|
|
ynh_mysql_drop_db "$dbname" 2>/dev/null || true
|
|
|
|
ynh_mysql_drop_user "$dbuser" 2>/dev/null || true
|
2014-07-20 18:10:20 +02:00
|
|
|
|
2016-07-23 14:54:26 +02:00
|
|
|
# Retrieve domain from app settings
|
|
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
|
|
|
|
|
|
|
# Delete app directory and configurations
|
2017-10-19 12:22:39 +02:00
|
|
|
rm -rf "/var/www/${app}"
|
|
|
|
rm -f "/etc/php5/fpm/pool.d/${app}.conf"
|
|
|
|
[[ -n $domain ]] && rm -f "/etc/nginx/conf.d/${domain}.d/${app}.conf"
|
2014-12-22 18:56:59 +01:00
|
|
|
|
2016-07-23 14:54:26 +02:00
|
|
|
# Reload services
|
2017-10-19 12:22:39 +02:00
|
|
|
service php5-fpm restart || true
|
|
|
|
service nginx reload || true
|