2016-03-28 22:14:19 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Load common variables and helpers
|
|
|
|
. ./_common.sh
|
|
|
|
|
|
|
|
# Set app specific variables
|
|
|
|
app=$1
|
|
|
|
dbname=$app
|
|
|
|
dbuser=$app
|
|
|
|
|
|
|
|
# Source app helpers
|
|
|
|
. /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
# Drop MySQL database and user
|
2016-05-22 22:55:22 +02:00
|
|
|
ynh_mysql_drop_db "$dbname" 2>&1 || true
|
|
|
|
ynh_mysql_drop_user "$dbuser" 2>&1 || true
|
2016-03-28 22:14:19 +02:00
|
|
|
|
|
|
|
# Retrieve domain from app settings
|
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
|
|
|
|
|
|
# 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
|
2016-05-17 13:15:38 +02:00
|
|
|
|
|
|
|
# Remove app dependencies
|
2016-05-22 22:55:22 +02:00
|
|
|
if ynh_package_is_installed "$DEPS_PKG_NAME"; then
|
|
|
|
ynh_package_autoremove "$DEPS_PKG_NAME"
|
|
|
|
fi
|