Make sure loh_helpers is sourced only once
This commit is contained in:
parent
27086af023
commit
8a655ae1a2
11
log_helpers
11
log_helpers
@ -1,11 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# set -x
|
# set -x
|
||||||
|
|
||||||
#if [ ${log_helpers_sourced:-1} = "1" ]; then
|
if [ ${log_helpers_sourced:-1} = "1" ]; then # include ony once
|
||||||
# readonly log_helpers_sourced=${BASH_SOURCE[0]}
|
readonly log_helpers_sourced=${BASH_SOURCE[0]}
|
||||||
#else
|
|
||||||
# return 0
|
|
||||||
#fi
|
|
||||||
|
|
||||||
readonly log_file=/var/log/update_controller.log
|
readonly log_file=/var/log/update_controller.log
|
||||||
if ! [ -f "$log_file" ]; then
|
if ! [ -f "$log_file" ]; then
|
||||||
@ -79,5 +76,5 @@ log_fatal() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
###############################################################################
|
||||||
# log "test message1" "test message2"
|
fi ### include guard
|
||||||
|
Loading…
Reference in New Issue
Block a user