Added MAINTENANCE flag (-m). If set, simulate WAIT-button in ISMAS

This commit is contained in:
Gerhard Hoffmann 2023-05-24 16:47:54 +02:00
parent 9eff70b780
commit 96d76b856a

View File

@ -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