1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/movim_ynh.git synced 2024-09-03 19:46:19 +02:00
movim_ynh/scripts/remove
2016-07-10 16:24:09 +02:00

37 lines
888 B
Bash

#!/bin/bash
app="movim"
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# Retrieve app settings
domain=$(ynh_app_setting_get "$app" domain)
# Stop service and remove init
sudo service php5-fpm stop
sudo /etc/init.d/movim stop
sudo systemctl stop movim.service
sudo systemctl disable movim.service
sudo update-rc.d -f movim remove
sudo rm -f /etc/init.d/movim
sudo rm -f /lib/systemd/system/movim.service
# Drop MySQL database and user
db_user=movim
db_name=movim
ynh_mysql_drop_db "$db_name" || true
ynh_mysql_drop_user "$db_user" || true
# Remove Movim files and user
ynh_system_user_exists movim \
&& sudo userdel movim
sudo rm -rf /var/www/movim
# Remove nginx and php-fpm configuration files
sudo rm -f /etc/nginx/conf.d/$domain.d/movim.conf
sudo rm -f /etc/php5/fpm/pool.d/movim.conf
# Restarting services
sudo service nginx reload
sudo service php5-fpm start