1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/emailpoubelle_ynh.git synced 2024-09-03 18:26:29 +02:00
emailpoubelle_ynh/scripts/remove

30 lines
856 B
Text
Raw Normal View History

2018-11-18 16:00:35 +01:00
#!/bin/bash
2018-11-21 00:22:08 +01:00
source _common.sh
source /usr/share/yunohost/helpers
2018-11-18 16:00:35 +01:00
db_user=emailPoubelle
db_name=$db_user
root_pwd=$(sudo cat /etc/yunohost/mysql)
domain=$(sudo yunohost app setting emailpoubelle domain)
postfix=/etc/postfix/main.cf
2018-11-21 00:22:08 +01:00
2018-11-18 16:00:35 +01:00
#removing emailpoubelle database
2018-11-21 00:22:08 +01:00
ynh_mysql_remove_db $db_user $db_name
2018-11-18 16:00:35 +01:00
#removing emailpoubelle directory
sudo rm -rf /var/www/emailpoubelle
#removing nginx conf
sudo rm -f /etc/nginx/conf.d/$domain.d/emailpoubelle.conf
2018-11-21 18:09:48 +01:00
#todo remove php-geoip
2018-11-18 16:00:35 +01:00
#removing aliases
sudo sed -i "/devnull:\/dev\/null/d" /etc/aliases
sudo newaliases
sudo sed -i "/virtual_alias_maps = hash:\/var\/www\/emailpoubelle\/var\/virtual/d" $postfix
sudo sed -i "s/^#virtual_alias_maps/virtual_alias_maps/g" $postfix
#remove cronjob
sudo rm -f /etc/cron.d/emailpoubelle
sudo service postfix reload
sudo service nginx reload
2018-11-21 00:22:08 +01:00
sudo yunohost app ssowatconf