Last active
December 17, 2015 12:09
-
-
Save devopsmariocom/5607945 to your computer and use it in GitHub Desktop.
Os Detection Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Assume unknown | |
dtype="unknown" | |
# First try use lsb_release if exists | |
if hash lsb_release 2>/dev/null; then | |
dtype=`lsb_release -is` | |
# Last but not least try OS X | |
elif [ $(uname -s) == "Darwin" ]; then | |
dtype="Darwin" | |
fi | |
echo $dtype |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment