From 96d76b856a739bc69a0bf90a9264981ac0baa482 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Wed, 24 May 2023 16:47:54 +0200 Subject: [PATCH] Added MAINTENANCE flag (-m). If set, simulate WAIT-button in ISMAS --- update_psa | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/update_psa b/update_psa index 3c7374c..4d8c014 100755 --- a/update_psa +++ b/update_psa @@ -5,6 +5,7 @@ # UPDATE PSA # Usage: # update_psa [ --? ] +# [ -m ] # [ --help ] # [ --wdir "working_directory" ] # [ --file "config_file" ] @@ -23,9 +24,15 @@ if [ -z $IFS ]; then IFS=$'\n' fi +MAINTENANCE="NO" + # parse commandline parameters while test $# -gt 0; do case $1 in + --maintenance | -m ) + shift + MAINTENANCE="YES" + ;; --file | --fil | --fi | --f | -file | -fil | -fi | -f ) shift CONFIGFILENAME="$1" @@ -47,6 +54,7 @@ while test $# -gt 0; do exit 0 ;; --dbg | --db | --d | -dbg | -db | -d ) + shift set_dbg_level $DEBUG ;; -*) @@ -71,14 +79,24 @@ if cd "$WORKING_DIRECTORY"; then then check_sanity_of_repository - set_updates_available - while : - do - sleep 5 - updates_available && break - done - - #update_psa "testing" + if [ "$MAINTENANCE" = "NO" ]; then + log_info "update_psa:${LINENO}: MAINTENANCE OFF. Checking for updates..." + # someone must have activated the WAIT-button in ISMAS. + # Request the status of this button in updates_available(). + if ! updates_available; then + update_psa_false_alarm "update requested, but no WAIT state detected !!!" + log_fatal "update_psa:${LINENO}: update requested, but no WAIT state detected !!!" + fi + else + # simulate an activated WAIT-button + set_updates_available + while : + do + sleep 5 + updates_available && break + done + fi + # updates available update_psa fi fi