Skip to content

Commit 5f902c4

Browse files
authored
asahi-diagnose: Use hostnamectl to fetch hostname
A default installation of Asahi Linux doesn't appear to come included with the `hostname` binary. This causes the hostname lookup to fail when asahi-diagnose is used. This technically ties the script to systemd, so a better solution if this becomes a concern (i.e. if different init systems are offered in the future) might be to check for the presence of the `hostname` binary, and if it's not present, go with a sensible alternative value instead of erroring out.
1 parent 16ab02e commit 5f902c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

asahi-diagnose

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ banner() {
1919
2020
Collected at: $(date) ($(date -Iseconds))
2121
Username: $(whoami)
22-
Hostname: $(hostname)
22+
Hostname: $(hostnamectl hostname)
2323
2424
EOF
2525
}

0 commit comments

Comments
 (0)