#!/usr/bin/env bash
################################################################################
# Check Aerospike Server dependencies
################################################################################

if [ $EUID -ne 0 ]; then
	echo "This script requires root or sudo privileges."
	exit 1
fi

################################################################################
# Python check

py_version=""
py_version=`python3 -c "import sys;t='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));sys.stdout.write(t)" 2>/dev/null;` ||
echo "WARN: Could not find python3. Asadm, asinfo, and asloglatency may fail."

supported_versions=("3.6" "3.7" "3.8" "3.9")
if [[ ! " ${supported_versions[@]} " =~ " ${py_version} " ]]; then
    echo "WARN: Could not find python 3.6, 3.7, 3.8, or 3.9. Asadm, asinfo, and asloglatency may fail."
fi

################################################################################
