|
|
|
@ -23,7 +23,7 @@
@@ -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
@@ -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
@@ -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}" |
|
|
|
|