]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - lib.sh
lib.sh: Add support for Solaris to os().
[config/dotfiles.git] / lib.sh
diff --git a/lib.sh b/lib.sh
index 49ce998660f3132b0b33d2bbca86e5ac936719f6..e1be32dc9d5ca45ed3a2868af8b4941674b1cc32 100644 (file)
--- a/lib.sh
+++ b/lib.sh
@@ -14,9 +14,12 @@ installed() {
     which $1 2>&1 | perl -ne 'if (not m{^/}) { exit 1 }'
 }
 
-# Prints the current OS. Supported are Debian (debian), Gentoo (gentoo) and
-# Mac OS X (darwin) at the moment. If an unsupported OS is used an error is
-# printed.
+# Print the current OS. The following OS are supported at the moment:
+# - Debian (debian)
+# - Gentoo (gentoo)
+# - Mac OS X (darwin)
+# - Solaris/OpenSolaris (sun)
+# If an unsupported OS is used an error is printed.
 os() {
     if [ -f /etc/debian_version ]; then
         echo debian
@@ -24,6 +27,8 @@ os() {
         echo gentoo
     elif [ x`uname` = xDarwin ]; then
         echo darwin
+    elif [ x`uname` = xSunOS ]; then
+        echo sun
     else
         echo unsupported OS! >&2
         return 1