Skip to content

Commit 9158a27

Browse files
committed
Rely on `uname' output for *BSD os decection
uname may be used to reliably detect most *BSD OSes (namely FreeBSD, NetBSD, OpenBSD, DragonFly), so use it. Otherwise it falls back to /var/run/dmesg.boot, which is not always available (e.g. jails) and is not as reliable anyway.
1 parent b05d09e commit 9158a27

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

screenfetch-dev

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,14 @@ detectdistro () {
582582
# Existing File Check
583583
if [ "$distro" == "Unknown" ]; then
584584
if [ $(uname -o 2>/dev/null) ]; then
585-
case "$(uname -o)" in
586-
"Cygwin")
587-
distro="Cygwin"
585+
os="$(uname -o)"
586+
case "$os" in
587+
"Cygwin"|"FreeBSD"|"OpenBSD"|"NetBSD")
588+
distro="$os"
589+
fake_distro="${distro}"
590+
;;
591+
"DragonFly")
592+
distro="DragonFlyBSD"
588593
fake_distro="${distro}"
589594
;;
590595
"Msys")

0 commit comments

Comments
 (0)