Compare commits

..

No commits in common. "96d76b856a739bc69a0bf90a9264981ac0baa482" and "515c77bed429225dc45402202af0ac45e6a64067" have entirely different histories.

5 changed files with 21 additions and 35 deletions

View File

@ -188,7 +188,7 @@ pull_customer_repository () {
# If 'git pull' has fetched new data, then there are lines starting with # If 'git pull' has fetched new data, then there are lines starting with
# DOWNLOAD or EXECUTE. # DOWNLOAD or EXECUTE.
grep -E -q "^[[:space:]]*(DOWNLOAD|EXECUTE)" "$GIT_UPDATE_LOG" grep -E -q "^[[:space:]]*(DOWNLOAD|EXECUTE)" "$GIT_UPDATE_LOG"
if [ $? -eq 0 ]; then if [ $? -eq 0]; then
log_info "$func:${LINENO}: new data fetched from repository" log_info "$func:${LINENO}: new data fetched from repository"
cd_home; return 0 cd_home; return 0
fi fi

View File

@ -18,7 +18,6 @@ if [ "${log_helpers_sourced:-1}" = "1" ]; then # include only once
readonly MAX_DEBUG_LEVEL=6 readonly MAX_DEBUG_LEVEL=6
log_level=$INFO log_level=$INFO
FATAL_FAILURE=false
set_dbg_level () { set_dbg_level () {
if [ $1 < $MAX_DEBUG_LEVEL ]; then if [ $1 < $MAX_DEBUG_LEVEL ]; then
@ -84,7 +83,6 @@ if [ "${log_helpers_sourced:-1}" = "1" ]; then # include only once
if [ $log_level -le $FATAL ]; then if [ $log_level -le $FATAL ]; then
log "FATAL $*" log "FATAL $*"
log "exiting ..." log "exiting ..."
FATAL_FAILURE=true
exit 1 exit 1
fi fi
} }

View File

@ -5,7 +5,6 @@
# 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" ]
@ -24,15 +23,9 @@ 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"
@ -54,7 +47,6 @@ 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
;; ;;
-*) -*)
@ -79,24 +71,14 @@ if cd "$WORKING_DIRECTORY"; then
then then
check_sanity_of_repository 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 set_updates_available
while : while :
do do
sleep 5 sleep 5
updates_available && break updates_available && break
done done
fi
# updates available #update_psa "testing"
update_psa update_psa
fi fi
fi fi

View File

@ -378,7 +378,7 @@ check_for_running_apism () {
if nc localhost 7778 if nc localhost 7778
then then
APISM_RUNNING=1 APISM_RUNNING=1
log_info "$func:${LINENO}: APISM is running..." log_debug "$func:${LINENO}: APISM running..."
return 0 return 0
fi fi
log_fatal "$func:${LINENO}: !!! APISM NOT RUNNING !!!" log_fatal "$func:${LINENO}: !!! APISM NOT RUNNING !!!"
@ -388,7 +388,7 @@ check_default_route () {
local func="${FUNCNAME[0]}" local func="${FUNCNAME[0]}"
if ip route | head -n 1 | grep -q '^default' if ip route | head -n 1 | grep -q '^default'
then then
log_info "$func:${LINENO}: default route set" log_debug "$func:${LINENO}: default route set"
return 0 return 0
fi fi
log_fatal "$func:${LINENO}: !!! NO DEFAULT ROUTE SET !!!" log_fatal "$func:${LINENO}: !!! NO DEFAULT ROUTE SET !!!"
@ -400,7 +400,7 @@ check_route_to_repository () {
# 185.191.219.134 via 192.168.5.254 ... # 185.191.219.134 via 192.168.5.254 ...
if test "$#" -eq 1 && ip route get "$1" | head -n 1 | grep -q "^$1" if test "$#" -eq 1 && ip route get "$1" | head -n 1 | grep -q "^$1"
then then
log_info "$func:${LINENO}: route to repository available" log_debug "$func:${LINENO}: route to repository available"
return 0 return 0
fi fi
log_fatal "$func:${LINENO}: !!! NO ROUTE TO REPO SET !!!" log_fatal "$func:${LINENO}: !!! NO ROUTE TO REPO SET !!!"

View File

@ -13,8 +13,6 @@ trap collect_current_configuration EXIT
collect_current_configuration () { collect_current_configuration () {
local func="${FUNCNAME[0]}" local func="${FUNCNAME[0]}"
$FATAL_FAILURE && return 1
# TODO: eventuell muss die version neu berechnet werden # TODO: eventuell muss die version neu berechnet werden
current_settings_to_ismas current_settings_to_ismas
@ -30,7 +28,15 @@ collect_current_configuration () {
#done #done
} }
update_psa() { update_psa() { # calling with a parameter is used for testing
if [ $# -eq 0 ]; then
if ! updates_available; then # check for false alarm
update_psa_false_alarm "update requested, but no WAIT state detected"
exit $EXITCODE
fi
fi
update_psa_activated # message to ISMAS update_psa_activated # message to ISMAS
local func="${FUNCNAME[0]}" local func="${FUNCNAME[0]}"