mirror of
https://github.com/YunoHost-Apps/spip_ynh.git
synced 2024-09-03 20:25:59 +02:00
34 lines
No EOL
900 B
Bash
34 lines
No EOL
900 B
Bash
#!/bin/bash
|
|
|
|
# Exit on command errors and treat unset variables as an error
|
|
set -u
|
|
|
|
# Source app helpers
|
|
source /usr/share/yunohost/helpers
|
|
|
|
# Get multi-instances specific variables
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
# Retrieve app settings
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
|
# with_mysql=$(ynh_app_setting_get "$app" with_mysql)
|
|
|
|
# Drop MySQL database and user as needed
|
|
#if [[ $with_mysql -eq 1 ]]; then
|
|
dbname=$app
|
|
dbuser=$app
|
|
dbpass=$(ynh_app_setting_get "$app" mysqlpwd)
|
|
ynh_mysql_drop_db $dbname || true
|
|
ynh_mysql_drop_user $dbuser || true
|
|
#fi
|
|
|
|
# Delete app directory and configurations
|
|
sudo rm -rf "/var/www/${app}"
|
|
sudo rm -f "/etc/php5/fpm/pool.d/${app}.conf"
|
|
sudo rm -f "/etc/php5/fpm/conf.d/20-${app}.ini"
|
|
[[ -n $domain ]] && sudo rm -f "/etc/nginx/conf.d/${domain}.d/${app}.conf"
|
|
|
|
# Reload services
|
|
sudo systemctl reload php5-fpm
|
|
sudo systemctl reload nginx
|
|
sudo yunohost app ssowatconf |