From a324de15d32c5dec4f5b8d98f60a755b1da333cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Mon, 13 Feb 2017 23:55:58 +0100 Subject: [PATCH] update 'remove' script --- scripts/remove | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/remove b/scripts/remove index e32e729..88a545a 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,13 +1,21 @@ #!/bin/bash +# Exit on command errors and treat unset variables as an error +set -eu + +# Source app helpers +. /usr/share/yunohost/helpers + db_user=freshrss db_name=freshrss -root_pwd=$(sudo cat /etc/yunohost/mysql) -domain=$(sudo yunohost app setting freshrss domain) +domain=$(ynh_app_setting_get freshrss domain) + +ynh_mysql_drop_db $db_name +ynh_mysql_drop_user $db_user -mysql -u root -p$root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user@localhost ;" sudo rm -rf /var/www/freshrss sudo rm -rf /etc/cron.d/freshrss sudo rm -f /etc/nginx/conf.d/$domain.d/freshrss.conf -sudo service nginx reload \ No newline at end of file +sudo service nginx reload +sudo yunohost app ssowatconf