Make sure loh_helpers is sourced only once

This commit is contained in:
Gerhard Hoffmann 2022-06-04 14:58:09 +02:00
parent 27086af023
commit 8a655ae1a2

View File

@ -1,11 +1,8 @@
#!/bin/bash
# set -x
#if [ ${log_helpers_sourced:-1} = "1" ]; then
# readonly log_helpers_sourced=${BASH_SOURCE[0]}
#else
# return 0
#fi
if [ ${log_helpers_sourced:-1} = "1" ]; then # include ony once
readonly log_helpers_sourced=${BASH_SOURCE[0]}
readonly log_file=/var/log/update_controller.log
if ! [ -f "$log_file" ]; then
@ -79,5 +76,5 @@ log_fatal() {
exit 1
fi
}
# log "test message1" "test message2"
###############################################################################
fi ### include guard