3
This commit is contained in:
13
lib/log.sh
13
lib/log.sh
@@ -1,6 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
log_init() {
|
||||
local fallback_dir=""
|
||||
local fallback_file=""
|
||||
|
||||
mkdir -p "$RUNTIME_LOG_DIR" 2>/dev/null || true
|
||||
if : > "$RUNTIME_LOG_FILE" 2>/dev/null; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
fallback_dir="${TMPDIR:-/tmp}/postinstall-debian-$(id -u)"
|
||||
fallback_file="$fallback_dir/install.log"
|
||||
mkdir -p "$fallback_dir"
|
||||
RUNTIME_LOG_DIR="$fallback_dir"
|
||||
RUNTIME_LOG_FILE="$fallback_file"
|
||||
: > "$RUNTIME_LOG_FILE"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user