core.func: fall back to a usable HOME when the shell has none (#17154)

This commit is contained in:
CanbiZ (MickLesk)
2026-09-11 07:41:44 +02:00
committed by GitHub
parent 28b4ae0b07
commit 785d33be40

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
# ==============================================================================