mirror of
https://github.com/dylanaraps/pfetch.git
synced 2026-01-02 16:02:12 +01:00
pfetch: fallback to /etc/hostname. Closes #83
This commit is contained in:
4
pfetch
4
pfetch
@@ -112,6 +112,10 @@ get_title() {
|
||||
# shellcheck disable=SC2039
|
||||
hostname=${HOSTNAME:-${hostname:-$(hostname)}}
|
||||
|
||||
# If the hostname is still not found, fallback to the contents of the
|
||||
# /etc/hostname file.
|
||||
[ "$hostname" ] || read -r hostname < /etc/hostname
|
||||
|
||||
log "[3${PF_COL3:-1}m${user}${c7}@[3${PF_COL3:-1}m${hostname}" " " >&6
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user