Mege with extenal repo
This commit is contained in:
21
scripts/detect-os-V2.sh
Normal file
21
scripts/detect-os-V2.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
dist_ver=$(grep --color=never -Po "^VERSION_ID=\K.*" "/etc/os-release")
|
||||
dist=$(grep --color=never -Po "^ID=\K.*" "/etc/os-release")
|
||||
|
||||
if [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"18.04"* ]]; then
|
||||
echo "Ubuntu 18.04 Detected"
|
||||
shortdist=ubu1804
|
||||
elif [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"20.04"* ]]; then
|
||||
echo "Ubuntu 20.04 Detected"
|
||||
shortdist=ubu2004
|
||||
elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"10"* ]]; then
|
||||
echo "Debian 10 Detected"
|
||||
shortdist=deb10
|
||||
elif [[ "${dist}" == *"centos"* ]] && [[ "${dist_ver}" == *"8"* ]]; then
|
||||
echo "Centos 8 Detected"
|
||||
shortdist=cent10
|
||||
else
|
||||
echo "This OS in not supported"
|
||||
fi
|
||||
|
||||
unset dist_ver
|
||||
unset dist
|
||||
Reference in New Issue
Block a user