1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/agendav_ynh.git synced 2024-09-03 20:36:12 +02:00
agendav_ynh/scripts/remove

23 lines
538 B
Bash

#!/bin/bash
# Set app specific variables
app="agendav"
dbname=$app
dbuser=$app
# Source app helpers
. /usr/share/yunohost/helpers
# Drop MySQL database and user
ynh_mysql_drop_db "$dbname" || true
ynh_mysql_drop_user "$dbuser" || true
# Retrieve domain from app settings
domain=$(ynh_app_setting_get "$app" domain)
# Delete app directory and configurations
sudo rm -rf "/var/www/${app}" "/var/log/${app}"
[[ -n $domain ]] && sudo rm -f "/etc/nginx/conf.d/${domain}.d/${app}.conf"
# Reload services
sudo service nginx reload || true