Skip to content

Instantly share code, notes, and snippets.

@ismail0352
Last active October 16, 2019 09:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ismail0352/e558599acc54af1bfc54913189ad1a78 to your computer and use it in GitHub Desktop.
Save ismail0352/e558599acc54af1bfc54913189ad1a78 to your computer and use it in GitHub Desktop.
Shell script for determining undelying distribution using ID
#!/bin/bash
DISTRO_ID=$(awk -F= '/^ID=/{print $2}' /etc/os-release | sed -e 's/^"//' -e 's/"$//')
# Install Salt Minion
if [ $DISTRO_ID == centos ]; then
echo "Do CENTOS stuff here"
elif [ $DISTRO_ID == ubuntu ]; then
echo "Do UBUNTU stuff here"
else
echo "OS not supported"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment