mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-19 15:32:59 +02:00
make.sh: Create a custom log function
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
15
make.sh
15
make.sh
@@ -95,6 +95,21 @@ resize_terminal
|
||||
# Call resize_terminal when terminal is being resized
|
||||
trap "resize_terminal" WINCH
|
||||
|
||||
# Writes a line to the log file
|
||||
log() {
|
||||
local line="$@"
|
||||
|
||||
# Fetch the current timestamp
|
||||
local t="$(date -u "+%b %e %T")"
|
||||
|
||||
# Append the line to file
|
||||
if [ -w "${LOGFILE}" ]; then
|
||||
echo "${t}: ${line}" >> "${LOGFILE}"
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
find_base() {
|
||||
local path
|
||||
|
||||
|
||||
Reference in New Issue
Block a user