2021-12-01 11:43:11 +00:00
|
|
|
#!/bin/bash
|
|
|
|
function get_openssl_version() {
|
2023-12-12 10:41:50 +00:00
|
|
|
local std_version=$1
|
|
|
|
if [[ ! "$std_version" =~ 3.*.* ]]; then
|
2021-12-01 11:43:11 +00:00
|
|
|
local script_version=${2:-}
|
|
|
|
local generic_version=${std_version%?}
|
|
|
|
local subpatch=${std_version: -1}
|
|
|
|
local subpatch_number=$(($(printf '%d' \'$subpatch) - 97 + 1))
|
|
|
|
subpatch_number="$(printf '%02d' $subpatch_number)"
|
|
|
|
script_version="$(printf '%02d' $script_version)"
|
|
|
|
local normalized_version="${generic_version}${subpatch_number}${script_version}"
|
|
|
|
echo $normalized_version
|
2023-12-12 10:41:50 +00:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
echo $std_version
|
2021-12-01 11:43:11 +00:00
|
|
|
}
|