Created
November 15, 2015 16:55
-
-
Save lukasz-golebiewski/34390c0af64fa46eec93 to your computer and use it in GitHub Desktop.
This file contains 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
detect_distro() | |
{ | |
if which lsb_release >/dev/null; then | |
local R=$(lsb_release -d -s) | |
echo "Distribution discovered: $R" | |
if [ -z "${R##Ubuntu 14.*}" ]; then | |
SYSTEMINITDAEMON=upstart | |
elif [ -z "${R##Ubuntu 15.04*}" ]; then | |
SYSTEMINITDAEMON=systemd | |
fi | |
else | |
echo "WARNING: Unknown distribution, assuming defaults - this may fail." >&2 | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment