Just use /etc/hostname all the time, please

This commit is contained in:
Salt 2022-04-15 22:10:00 -05:00
parent 606a31c422
commit e13a5a4b88

View File

@ -328,12 +328,8 @@ _ps1bash() {
# Add hostname prefix in SSH sessions # Add hostname prefix in SSH sessions
unset _prefix unset _prefix
# Get the system hostname, using a util if one's available # Get the system hostname
if command -v hostname; then _hostname="$(</etc/hostname)"
_hostname="$(hostname -s)"
else
_hostname="$(</etc/hostname)"
fi
# Alert if in an SSH session # Alert if in an SSH session
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
_prefix="${fg_bold}${fg_red}${_hostname}${r}${fg_red}:${r}${_prefix}" _prefix="${fg_bold}${fg_red}${_hostname}${r}${fg_red}:${r}${_prefix}"