add isUbuntu22 and isUbuntuVer
This commit is contained in:
@@ -14,6 +14,17 @@ function isUbuntu20() {
|
|||||||
[[ "${VERSION_ID}" =~ ^20\.(.*)$ ]]
|
[[ "${VERSION_ID}" =~ ^20\.(.*)$ ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isUbuntu22() {
|
||||||
|
. /etc/os-release
|
||||||
|
[[ "${VERSION_ID}" =~ ^22\.(.*)$ ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
function isUbuntuVer() {
|
||||||
|
local ver=$1
|
||||||
|
. /etc/os-release
|
||||||
|
[[ "${VERSION_ID}" =~ ^$ver\.(.*)$ ]]
|
||||||
|
}
|
||||||
|
|
||||||
function getOSVersionLabel() {
|
function getOSVersionLabel() {
|
||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
echo "${VERSION_CODENAME}"
|
echo "${VERSION_CODENAME}"
|
||||||
|
|||||||
Reference in New Issue
Block a user