zshrc: updated OS recognition functions
authorMoviuro <moviuro+grml@gmail.com>
Mon, 15 Sep 2014 10:07:37 +0000 (12:07 +0200)
committerFrank Terbeck <ft@grml.org>
Mon, 15 Sep 2014 10:24:13 +0000 (12:24 +0200)
TODO: add more to the list (e.g. *BSDs, Solaris...)

etc/zsh/zshrc

index 295e55d..1b051a5 100644 (file)
@@ -180,14 +180,22 @@ else
     isgrmlsmall() { return 1 }
 fi
 
+GRML_OSTYPE=$(uname -s)
+
+islinux(){
+    [[ $GRML_OSTYPE == "Linux" ]]
+}
+
 isdarwin(){
-    [[ $OSTYPE == darwin* ]] && return 0
-    return 1
+    [[ $GRML_OSTYPE == "Darwin" ]]
 }
 
 isfreebsd(){
-    [[ $OSTYPE == freebsd* ]] && return 0
-    return 1
+    [[ $GRML_OSTYPE == "FreeBSD" ]]
+}
+
+isopenbsd(){
+    [[ $GRML_OSTYPE == "OpenBSD" ]]
 }
 
 #f1# are we running within an utf environment?