Compare commits

...

2 Commits

Author SHA1 Message Date
CanbiZ (MickLesk)
e2e72756db Initialize HOME variable for script execution
Set HOME variable if not already defined to prevent script failures.
2026-09-10 14:08:12 +02:00
MickLesk
f419485678 core.func: fall back to a usable HOME when the shell has none 2026-09-10 14:02:01 +02:00

View File

@@ -15,6 +15,11 @@
[[ -n "${_CORE_FUNC_LOADED:-}" ]] && return
_CORE_FUNC_LOADED=1
if [[ -z "${HOME:-}" ]]; then
HOME="$(getent passwd "$(id -u)" 2>/dev/null | cut -d: -f6)"
export HOME="${HOME:-/root}"
fi
# ==============================================================================
# SECTION 1: INITIALIZATION & SETUP
# ==============================================================================