#!/bin/bash source /etc/os-release #echo used Vars for testing only echo $VERSION #formaring $VERSION to a useable fromat VERSION=$(echo $VERSION | grep -o '[0-9]\+.' | tr -d '\n') #echo used Vars for testing only echo $ID echo $VERSION #example if statement if [ "$ID" = "debian" ]; then echo "Execute Commands" elif [ "$ID" = "ubuntu" ]; then echo "Executue Ubuntu version detection" if [[ "$VERSION" == "18.04"* ]]; then echo "this ubuntu Ubuntu 18.04" elif [[ "$VERSION" == "16.04"* ]]; then echo "this ubuntu 16.04" else echo "this version of ubuntu is not yet supported" fi elif [ "$ID" = "centos" ]; then echo "Executue Centos Commands" elif [ "$ID" = "rhel" ]; then echo "Executue Red hat enterpise Linux Commands" else echo "this OS is not yet supported" fi