1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#!/bin/bash DISTRO=$(hostnamectl | grep 'Operating System' | cut -d ' ' -f 3-) echo $DISTRO COUNT=$(grep -c "$DISTRO" distros-supported.txt) echo $COUNT if [[ $COUNT -ne 1 ]]; then echo "Distro not supported" echo "Please check distro list ..." sleep 10 exit 1 else echo "Your distro is supported. Installation can continue ..." sleep 3 fi