mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-09-11 08:22:44 +00:00
core.func: fall back to a usable HOME when the shell has none (#17154)
This commit is contained in:
committed by
GitHub
parent
28b4ae0b07
commit
785d33be40
@@ -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
|
||||
# ==============================================================================
|
||||
|
||||
Reference in New Issue
Block a user