mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-09-11 00:16:57 +00:00
Initialize HOME variable for script execution
Set HOME variable if not already defined to prevent script failures.
This commit is contained in:
committed by
GitHub
parent
f419485678
commit
e2e72756db
@@ -15,10 +15,6 @@
|
||||
[[ -n "${_CORE_FUNC_LOADED:-}" ]] && return
|
||||
_CORE_FUNC_LOADED=1
|
||||
|
||||
# The shell behind the Proxmox web UI (xterm.js) starts without HOME. Every
|
||||
# version file and toolchain here is resolved beneath it, and under `set -u` the
|
||||
# first expansion aborts the script instead of falling back. Anchor it once so
|
||||
# the ~40 expansions downstream do not each need a guard.
|
||||
if [[ -z "${HOME:-}" ]]; then
|
||||
HOME="$(getent passwd "$(id -u)" 2>/dev/null | cut -d: -f6)"
|
||||
export HOME="${HOME:-/root}"
|
||||
|
||||
Reference in New Issue
Block a user