Skip to content

[Feature Request]: check/ck_os_version: check if os version is not less than given value #77

@aronchanisme

Description

@aronchanisme

Is there an existing issue for the feature request?

  • I have checked the existing issues.

Feature Description

check/ck_os_version: check if os version is not less than given value

usage: 
check/ck_os_version.sh <os_version>, where,
os_version: e.g. 12.0

example:
check/ck_os_version.sh 12.0

output:
return 0: if os version is not less than given value
return 1:  if os version is less than given value, or invalid usage

Feature Implementation

Linux:

  • Debian: os_version=cat /etc/debian_version
  • CentOS/TencentOS: os_version=cat /etc/centos-release | awk '{print $4}'
  • Others: os_version=grep "^VERSION_ID=" /etc/os-release | awk -F "=" '{print $2}' | sed 's#"##g'

Mac: os_version=sw_vers | grep "ProductVersion" | awk '{print $2}'

Additional information

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions