From d4dd113a59d70315fb321323b1427163ee6c80a2 Mon Sep 17 00:00:00 2001 From: Doug Le Tough Date: Tue, 25 Jul 2017 13:29:40 +0200 Subject: [PATCH] "test sys_refresh_ref_cron.sh" --- bin/sys_refresh_ref_cron.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/sys_refresh_ref_cron.sh b/bin/sys_refresh_ref_cron.sh index f42ca8f..2f87098 100755 --- a/bin/sys_refresh_ref_cron.sh +++ b/bin/sys_refresh_ref_cron.sh @@ -23,7 +23,7 @@ # Ce script n'accepte *aucune* option # # @OPT: f:force:force:1/1:false::: -# @OPT: f:show-only:show-only:1/1:false::: +# @OPT: f:show_only:show-only:1/1:false::: # #------------------------------------------------------------------------------------------------------------------ # Liste des erreurs: @@ -122,6 +122,7 @@ function check_config fi fct_message " * DB_TABLE: ${DB_TABLE}" fct_message " * Force: ${force}" + fct_message " * Show only: ${show_only}" if [ ${#TETALAB_USERS[*]} -eq 0 ]; then ERROR="Aucune VM définie dans le fichier de configuration" fct_erreur 2 @@ -153,7 +154,7 @@ function get_db_info function clean_table { - if [ "${force}" == "true" ]; then + if [ "${force}" == "true" ] && [ "${show_only}" == "false" ]; then fct_message "Option -force activée: Suppression des données dans la table." -color orange SQL="delete from ref_cron where id > 0;" psql -q -t -h ${DB_HOST} -U ${DB_USER} -d ${DB_DATABASE} -c "${SQL}"