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 # UPDATE PSA
# Usage: # Usage:
# update_psa [ --? ] # update_psa [ --? ]
# [ -m ]
# [ --help ] # [ --help ]
# [ --wdir "working_directory" ] # [ --wdir "working_directory" ]
# [ --file "config_file" ] # [ --file "config_file" ]
@ -23,9 +24,15 @@ if [ -z $IFS ]; then
IFS=$'\n' IFS=$'\n'
fi fi
MAINTENANCE="NO"
# parse commandline parameters # parse commandline parameters
while test $# -gt 0; do while test $# -gt 0; do
case $1 in case $1 in
--maintenance | -m )
shift
MAINTENANCE="YES"
;;
--file | --fil | --fi | --f | -file | -fil | -fi | -f ) --file | --fil | --fi | --f | -file | -fil | -fi | -f )
shift shift
CONFIGFILENAME="$1" CONFIGFILENAME="$1"
@ -47,6 +54,7 @@ while test $# -gt 0; do
exit 0 exit 0
;; ;;
--dbg | --db | --d | -dbg | -db | -d ) --dbg | --db | --d | -dbg | -db | -d )
shift
set_dbg_level $DEBUG set_dbg_level $DEBUG
;; ;;
-*) -*)
@ -71,14 +79,24 @@ if cd "$WORKING_DIRECTORY"; then
then then
check_sanity_of_repository check_sanity_of_repository
set_updates_available if [ "$MAINTENANCE" = "NO" ]; then
while : log_info "update_psa:${LINENO}: MAINTENANCE OFF. Checking for updates..."
do # someone must have activated the WAIT-button in ISMAS.
sleep 5 # Request the status of this button in updates_available().
updates_available && break if ! updates_available; then
done update_psa_false_alarm "update requested, but no WAIT state detected !!!"
log_fatal "update_psa:${LINENO}: update requested, but no WAIT state detected !!!"
#update_psa "testing" fi
else
# simulate an activated WAIT-button
set_updates_available
while :
do
sleep 5
updates_available && break
done
fi
# updates available
update_psa update_psa
fi fi
fi fi