add isUbuntu22 and isUbuntuVer

This commit is contained in:
Ryan
2022-05-02 10:33:32 +00:00
committed by GitHub
parent 74a51cb0fb
commit 05d1012eec
+11
View File
@@ -14,6 +14,17 @@ function isUbuntu20() {
[[ "${VERSION_ID}" =~ ^20\.(.*)$ ]]
}
function isUbuntu22() {
. /etc/os-release
[[ "${VERSION_ID}" =~ ^22\.(.*)$ ]]
}
function isUbuntuVer() {
local ver=$1
. /etc/os-release
[[ "${VERSION_ID}" =~ ^$ver\.(.*)$ ]]
}
function getOSVersionLabel() {
. /etc/os-release
echo "${VERSION_CODENAME}"