Check the OS version after ensuring bc is available
This commit is contained in:
@ -9,6 +9,11 @@ check_os_version() {
|
||||
exit 1
|
||||
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 ]] ||
|
||||
[[ "$os_name" == "debian" && $(echo "$os_version >= 11" | bc) -eq 1 ]]; then
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user