Moved main parts to update_psa_impl.

This commit is contained in:
Gerhard Hoffmann 2023-05-26 15:07:13 +02:00
parent 901fa4c319
commit 215b155f2d

View File

@ -70,43 +70,9 @@ done
source ./update_psa_impl
if [ -z "$WORKING_DIRECTORY" ]; then
log_fatal "update_psa:${LINENO}: empty WORKING_DIRECTORY"
fi
if ! cd "$WORKING_DIRECTORY"; then
log_fatal "update_psa:${LINENO}: cannot cd to $WORKING_DIRECTORY"
fi
log_info "update_psa:${LINENO}: cd to $WORKING_DIRECTORY"
if read_config; then
check_default_route
check_route_to_repository "185.191.219.134" # git.mimbach.de
check_for_running_apism
if clone_customer_repository ${CUSTOMER_REPOSITORY_PATH}; then
check_sanity_of_repository
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
update_psa
exit 0
fi
exit 0
exit 1
###############################################################################