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

38 lines
888 B
Text
Raw Normal View History

2015-08-03 12:05:52 +02:00
#!/bin/bash
app="movim"
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# Retrieve app settings
domain=$(ynh_app_setting_get "$app" domain)
2015-08-03 12:05:52 +02:00
# Stop service and remove init
2015-09-03 17:24:46 +02:00
sudo service php5-fpm stop
2015-08-03 12:07:36 +02:00
sudo /etc/init.d/movim stop
sudo systemctl stop movim.service
sudo systemctl disable movim.service
2015-08-04 10:50:43 +02:00
sudo update-rc.d -f movim remove
sudo rm -f /etc/init.d/movim
sudo rm -f /lib/systemd/system/movim.service
2015-08-03 12:05:52 +02:00
# 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
2015-08-03 12:05:52 +02:00
# Restarting services
sudo service nginx reload
2015-09-03 17:24:46 +02:00
sudo service php5-fpm start