1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/monitorix_ynh.git synced 2024-09-03 19:46:06 +02:00
monitorix_ynh/scripts/remove
2017-05-26 15:02:19 +02:00

30 lines
560 B
Bash
Executable file

#!/bin/bash
# Import common cmd
source ./_common.sh
# Init script
init_script
# Retrieve app settings
domain=$(ynh_app_setting_get "$app" domain)
# Stop service
sudo service monitorix stop || true
# Remove nginx configuration file
sudo rm -f /etc/nginx/conf.d/$domain.d/$app.conf
# Drop MySQL database and user
dbname=$app
dbuser=$app
ynh_mysql_drop_db "$dbname" || true
ynh_mysql_drop_user "$dbuser" || true
# Autoremove package
ynh_package_autoremove monitorix
sudo yunohost service remove monitorix
# Reload nginx service
sudo service nginx reload