Skip to content

Commit

Permalink
Rely on `uname' output for *BSD os decection
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
AMDmi3 committed Oct 28, 2016
1 parent b05d09e commit 9158a27
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions screenfetch-dev
Expand Up @@ -582,9 +582,14 @@ detectdistro () {
# Existing File Check
if [ "$distro" == "Unknown" ]; then
if [ $(uname -o 2>/dev/null) ]; then
case "$(uname -o)" in
"Cygwin")
distro="Cygwin"
os="$(uname -o)"
case "$os" in
"Cygwin"|"FreeBSD"|"OpenBSD"|"NetBSD")
distro="$os"
fake_distro="${distro}"
;;
"DragonFly")
distro="DragonFlyBSD"
fake_distro="${distro}"
;;
"Msys")
Expand Down

0 comments on commit 9158a27

Please sign in to comment.