mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-09-12 09:56:37 +02: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
|
[[ -n "${_CORE_FUNC_LOADED:-}" ]] && return
|
||||||
_CORE_FUNC_LOADED=1
|
_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
|
# SECTION 1: INITIALIZATION & SETUP
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user