#!/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

if which python > /dev/null 2>&1;
then
    # Python is installed
    py_version=`python -c "import sys;t='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));sys.stdout.write(t)";`
	if [[ "$py_version" != "2.7" ]]; then
		echo "Dependency not found: python 2.7+ (< 3)"
		exit 1
	fi
else
    # Python is not installed
    echo "Dependency not found: python 2.7+ (< 3)"
    exit 1
fi

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