Check the OS version after ensuring bc is available

This commit is contained in:
Whispering Wind
2024-09-03 00:19:59 +03:30
committed by GitHub
parent c8f9323205
commit b6f8e8f40a

View File

@ -9,6 +9,11 @@ check_os_version() {
exit 1 exit 1
fi fi
if ! command -v bc &> /dev/null; then
echo "The 'bc' command is required but not installed. Installing..."
apt update && apt install -y bc
fi
if [[ "$os_name" == "ubuntu" && $(echo "$os_version >= 22" | bc) -eq 1 ]] || if [[ "$os_name" == "ubuntu" && $(echo "$os_version >= 22" | bc) -eq 1 ]] ||
[[ "$os_name" == "debian" && $(echo "$os_version >= 11" | bc) -eq 1 ]]; then [[ "$os_name" == "debian" && $(echo "$os_version >= 11" | bc) -eq 1 ]]; then
return 0 return 0