From 546581d642cdd9f7e2d4bde80c1d3a0ded3e7793 Mon Sep 17 00:00:00 2001 From: Jocelyn Delalande Date: Mon, 19 Jun 2017 01:59:53 +0200 Subject: [PATCH] [ehn] Use MySQL drop helpers --- scripts/install | 4 ++-- scripts/remove | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index caf57a7..e7177a6 100755 --- a/scripts/install +++ b/scripts/install @@ -41,8 +41,8 @@ ynh_app_setting_set $app mysqlpwd $db_pwd function exit_properly { set +e - root_pwd=$(sudo cat /etc/yunohost/mysql) - mysql -u root -p$root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user ;" + ynh_mysql_drop_db $db_name + ynh_mysql_drop_user $db_user sudo userdel ihatemoney sudo rm -Rf /opt/yunohost/ihatemoney sudo rm -Rf /etc/ihatemoney diff --git a/scripts/remove b/scripts/remove index 41d4af9..e7c94a4 100755 --- a/scripts/remove +++ b/scripts/remove @@ -15,7 +15,8 @@ db_name=$app root_pwd=$(sudo cat /etc/yunohost/mysql) # Drop database -mysql -u root -p$root_pwd -e "DROP DATABASE $db_name ; DROP USER $db_user@localhost ;" +ynh_mysql_drop_db $db_name +ynh_mysql_drop_user $db_user # Remove src sudo rm -rf /opt/yunohost/ihatemoney/