From 0d6be340405a23f90977ba42d7e902db95cc82c0 Mon Sep 17 00:00:00 2001 From: Etienne Pallier Date: Mon, 4 Jul 2016 11:52:27 +0200 Subject: [PATCH] renamed db-update-2016-07-01.sh -> db-update-2016-07-01-irap.sh --- database/update/db-update-2016-07-01-irap.sh | 34 ++++++++++++++++++++++++++++++++++ database/update/db-update-2016-07-01.sh | 34 ---------------------------------- 2 files changed, 34 insertions(+), 34 deletions(-) create mode 100755 database/update/db-update-2016-07-01-irap.sh delete mode 100755 database/update/db-update-2016-07-01.sh diff --git a/database/update/db-update-2016-07-01-irap.sh b/database/update/db-update-2016-07-01-irap.sh new file mode 100755 index 0000000..0c661dc --- /dev/null +++ b/database/update/db-update-2016-07-01-irap.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Pour Mac OS recent (10.10, Yosemite), la syntaxe du SED est differente +# Il faut donc faire une copie de ce fichier et transformer les instructions sed a l'interieur +# Pour cela, il suffit d'executer ces 2 lignes : +# cp ce_script.sh ce_script_macosx.sh +# sed -e "s/ -i / -i '' /" -i '' ce_script_macosx.sh + +if [ ! -f ../../config/app.php ] ; then +echo "Vous devez executer ce script depuis le dossier database/update/" +exit 1 +fi + + +# Get login, pass, dbname, and hostname +username=$(grep "/\*d\*/'username'" ../../config/app.php | cut -d"'" -f4) +password=$(grep "/\*d\*/'password'" ../../config/app.php | cut -d"'" -f4) +database=$(grep "/\*d\*/'database'" ../../config/app.php | cut -d"'" -f4) +host=$(grep "/\*d\*/'host'" ../../config/app.php | cut -d"'" -f4) + + +cp -p ./script_sql/db-update-2016-07-01-irap.sql ./script_sql/db-update-2016-07-01-irap-build.sql + +# Execute sql update script +sed -e "s/database/$database/" -i ./script_sql/db-update-2016-07-01-irap-build.sql +mysql --user=$username --password=$password -h $host < ./script_sql/db-update-2016-07-01-irap-build.sql + +# Delete cakephp cache +sudo rm ../../tmp/cache/models/* +sudo rm ../../tmp/cache/persistent/* + +sudo chmod -R 777 ../../tmp +sudo chmod -R 777 ../../vendor +sudo chmod -R 777 ../../webroot diff --git a/database/update/db-update-2016-07-01.sh b/database/update/db-update-2016-07-01.sh deleted file mode 100755 index 0c661dc..0000000 --- a/database/update/db-update-2016-07-01.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Pour Mac OS recent (10.10, Yosemite), la syntaxe du SED est differente -# Il faut donc faire une copie de ce fichier et transformer les instructions sed a l'interieur -# Pour cela, il suffit d'executer ces 2 lignes : -# cp ce_script.sh ce_script_macosx.sh -# sed -e "s/ -i / -i '' /" -i '' ce_script_macosx.sh - -if [ ! -f ../../config/app.php ] ; then -echo "Vous devez executer ce script depuis le dossier database/update/" -exit 1 -fi - - -# Get login, pass, dbname, and hostname -username=$(grep "/\*d\*/'username'" ../../config/app.php | cut -d"'" -f4) -password=$(grep "/\*d\*/'password'" ../../config/app.php | cut -d"'" -f4) -database=$(grep "/\*d\*/'database'" ../../config/app.php | cut -d"'" -f4) -host=$(grep "/\*d\*/'host'" ../../config/app.php | cut -d"'" -f4) - - -cp -p ./script_sql/db-update-2016-07-01-irap.sql ./script_sql/db-update-2016-07-01-irap-build.sql - -# Execute sql update script -sed -e "s/database/$database/" -i ./script_sql/db-update-2016-07-01-irap-build.sql -mysql --user=$username --password=$password -h $host < ./script_sql/db-update-2016-07-01-irap-build.sql - -# Delete cakephp cache -sudo rm ../../tmp/cache/models/* -sudo rm ../../tmp/cache/persistent/* - -sudo chmod -R 777 ../../tmp -sudo chmod -R 777 ../../vendor -sudo chmod -R 777 ../../webroot -- libgit2 0.21.2