diff --git a/scripts/remove b/scripts/remove index e673a00..9002704 100644 --- a/scripts/remove +++ b/scripts/remove @@ -1,12 +1,17 @@ #!/bin/bash +source _common.sh +source /usr/share/yunohost/helpers + + 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 + #removing emailpoubelle database -sudo mysql -u root -p$root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user@localhost ;" +ynh_mysql_remove_db $db_user $db_name #removing emailpoubelle directory sudo rm -rf /var/www/emailpoubelle #removing nginx conf @@ -20,4 +25,4 @@ sudo sed -i "s/^#virtual_alias_maps/virtual_alias_maps/g" $postfix sudo rm -f /etc/cron.d/emailpoubelle sudo service postfix reload sudo service nginx reload -sudo yunohost app ssowatconf \ No newline at end of file +sudo yunohost app ssowatconf