From 3c207dbe11c0abf40b5c698285b7da602c545bb7 Mon Sep 17 00:00:00 2001 From: magikcypress Date: Sat, 11 Mar 2017 00:32:17 +0100 Subject: [PATCH] =?UTF-8?q?Sans=20with=20mysql=20pour=20v=C3=A9rifier=20si?= =?UTF-8?q?=20Linter=20passe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/restore | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/restore b/scripts/restore index e4bca8f..0f6132c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers domain=$(ynh_app_setting_get $app domain) path=$(ynh_app_setting_get $app path) is_public=$(ynh_app_setting_get $app is_public) -with_mysql=$(ynh_app_setting_get "$app" with_mysql) +# with_mysql=$(ynh_app_setting_get "$app" with_mysql) # Check domain/path availability sudo yunohost app checkurl "${domain}${path}" -a "$app" \ @@ -49,17 +49,17 @@ sudo cp -a ./sources "$final_path" sudo chown -R www-data: $final_path # Restore db -if [[ $with_mysql -eq 1 ]]; then - db_pwd=$(ynh_app_setting_get $app mysqlpwd) - db_user=$app - ynh_mysql_create_db $db_user $db_user $db_pwd - sudo su -c "mysql -u $db_user -p$db_pwd $app < ./db.sql" - sudo rm -f "./db.sql" - # sudo sed -i -e "s/'__DB_USER__', *'[^']*'/'__DB_USER__', '$app'/g" $final_path/config/connect.php - # sudo sed -i -e "s/'__DB_PWD__', *'[^']*'/'__DB_PWD__', '$app'/g" $final_path/config/connect.php - sudo sed -i "s@__DB_USER__@$db_user@g" $final_path/config/connect.php - sudo sed -i "s@__DB_PWD__@$db_pwd@g" $final_path/config/connect.php -fi +# if [[ $with_mysql -eq 1 ]]; then +db_pwd=$(ynh_app_setting_get $app mysqlpwd) +db_user=$app +ynh_mysql_create_db $db_user $db_user $db_pwd +sudo su -c "mysql -u $db_user -p$db_pwd $app < ./db.sql" +sudo rm -f "./db.sql" +# sudo sed -i -e "s/'__DB_USER__', *'[^']*'/'__DB_USER__', '$app'/g" $final_path/config/connect.php +# sudo sed -i -e "s/'__DB_PWD__', *'[^']*'/'__DB_PWD__', '$app'/g" $final_path/config/connect.php +sudo sed -i "s@__DB_USER__@$db_user@g" $final_path/config/connect.php +sudo sed -i "s@__DB_PWD__@$db_pwd@g" $final_path/config/connect.php +# fi # Restore nginx configuration files sudo cp -a ./nginx.conf "$nginx_conf"