Compare commits
4 Commits
515c77bed4
...
96d76b856a
Author | SHA1 | Date | |
---|---|---|---|
96d76b856a | |||
9eff70b780 | |||
2a8be547a8 | |||
17521771e3 |
@ -188,7 +188,7 @@ pull_customer_repository () {
|
||||
# If 'git pull' has fetched new data, then there are lines starting with
|
||||
# DOWNLOAD or EXECUTE.
|
||||
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"
|
||||
cd_home; return 0
|
||||
fi
|
||||
|
@ -18,6 +18,7 @@ if [ "${log_helpers_sourced:-1}" = "1" ]; then # include only once
|
||||
readonly MAX_DEBUG_LEVEL=6
|
||||
|
||||
log_level=$INFO
|
||||
FATAL_FAILURE=false
|
||||
|
||||
set_dbg_level () {
|
||||
if [ $1 < $MAX_DEBUG_LEVEL ]; then
|
||||
@ -83,6 +84,7 @@ if [ "${log_helpers_sourced:-1}" = "1" ]; then # include only once
|
||||
if [ $log_level -le $FATAL ]; then
|
||||
log "FATAL $*"
|
||||
log "exiting ..."
|
||||
FATAL_FAILURE=true
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
34
update_psa
34
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
|
||||
|
@ -378,7 +378,7 @@ check_for_running_apism () {
|
||||
if nc localhost 7778
|
||||
then
|
||||
APISM_RUNNING=1
|
||||
log_debug "$func:${LINENO}: APISM running..."
|
||||
log_info "$func:${LINENO}: APISM is running..."
|
||||
return 0
|
||||
fi
|
||||
log_fatal "$func:${LINENO}: !!! APISM NOT RUNNING !!!"
|
||||
@ -388,7 +388,7 @@ check_default_route () {
|
||||
local func="${FUNCNAME[0]}"
|
||||
if ip route | head -n 1 | grep -q '^default'
|
||||
then
|
||||
log_debug "$func:${LINENO}: default route set"
|
||||
log_info "$func:${LINENO}: default route set"
|
||||
return 0
|
||||
fi
|
||||
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 ...
|
||||
if test "$#" -eq 1 && ip route get "$1" | head -n 1 | grep -q "^$1"
|
||||
then
|
||||
log_debug "$func:${LINENO}: route to repository available"
|
||||
log_info "$func:${LINENO}: route to repository available"
|
||||
return 0
|
||||
fi
|
||||
log_fatal "$func:${LINENO}: !!! NO ROUTE TO REPO SET !!!"
|
||||
|
@ -13,6 +13,8 @@ trap collect_current_configuration EXIT
|
||||
collect_current_configuration () {
|
||||
local func="${FUNCNAME[0]}"
|
||||
|
||||
$FATAL_FAILURE && return 1
|
||||
|
||||
# TODO: eventuell muss die version neu berechnet werden
|
||||
current_settings_to_ismas
|
||||
|
||||
@ -28,15 +30,7 @@ collect_current_configuration () {
|
||||
#done
|
||||
}
|
||||
|
||||
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() {
|
||||
update_psa_activated # message to ISMAS
|
||||
|
||||
local func="${FUNCNAME[0]}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user