From 117fd4864d428fc93cd2c6d24637810656ff7a18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Sun, 4 Sep 2016 12:04:50 +0200 Subject: [PATCH] [enh][WIP]remove deprecated initdb --- scripts/install | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index df3644d..29d7aec 100755 --- a/scripts/install +++ b/scripts/install @@ -37,9 +37,9 @@ db_pwd=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | app_salt=$(dd if=/dev/urandom bs=1 count=200 2> /dev/null | tr -c -d 'A-Za-z0-9' | sed -n 's/\(.\{40\}\).*/\1/p') # Use 'freshrss' as database name and user db_user=freshrss - +db_name=freshrss # Initialize database and store mysql password for upgrade -sudo yunohost app initdb $db_user -p $db_pwd +ynh_mysql_create_db "$db_name" "$db_user" "$db_pwd" sudo yunohost app setting freshrss mysqlpwd -v $db_pwd # Copy files to the right place @@ -85,7 +85,9 @@ do #change username in sql sudo sed -i "s/YnoUser/$myuser/g" /tmp/$myuser-install.sql #create tables - mysql -u $db_user -p$db_pwd $db_user < /tmp/$myuser-install.sql + ynh_mysql_connect_as "$db_user" "$db_pwd" "$db_name" \ + < "/tmp/$myuser-install.sql" + #remove temp sql sudo rm /tmp/$myuser-install.sql #copy default conf