<commit_before>#!/bin/bash
# Uncomment if you want to debug this script.
#set -x

#Define some global variables

FLT_CARRIER=8
FLT_PBX=9
REQ_PYTHON_MAJOR_VER=3
SYSTEM_KAMAILIO_CONF_DIR=/etc/kamailio
DSIP_KAMAILIO_CONF_DIR=$(pwd)
DEBUG=0 # By default debugging is turned off, but can be enabled during startup by using "start -debug" parameters

#Default MYSQL install values

MYSQL_KAM_DEF_USERNAME=kamailio
MYSQL_KAM_DEF_PASSWORD="<PASSWORD>"
MYSQL_KAM_DEF_DATABASE="kamailio"

#Grab the port being using
DSIP_PORT=$(cat ${DSIP_KAMAILIO_CONF_DIR}/gui/settings.py | grep -oP 'DSIP_PORT=\K[0-9]*')

# Get Linux Distro

if [ -f /etc/redhat-release ]; then
 	DISTRO="centos"
    elif [ -f /etc/debian_version ]; then
	DISTRO="debian"
    fi  


# Uncomment and set this variable to an explicit Python executable file name
# If set, the script will not try and find a Python version with 3.5 as the major release number
#PYTHON_CMD=/usr/bin/python3.4

function isPythonInstalled {


possible_python_versions=`find / -name "python$REQ_PYTHON_MAJOR_VER*" -type f -executable  2>/dev/null`
for i in $possible_python_versions
do
    ver=`$i -V 2>&1`
    if [ $? -eq 0 ]; then  #Check if the version parameter is working correctly
    	echo $ver | grep $REQ_PYTHON_MAJOR_VER >/dev/null
    	if [ $? -eq 0 ]; then
        	PYTHON_CMD=$i
       		return
    	fi
    fi
done

#Required version of Python is not found.  So, tell the user to install the required version
echo -e "\nPlease install at least python version $REQ_PYTHON_VER\n"
exit

}

function configureKamailio {

echo -e "[Database Configuration]\n"
echo -e "Please enter the username for the Kamailio schema [default $MYSQL_KAM_DEF_USERNAME]:\c"
read MYSQL_KAM_USERNAME

echo -e "Please enter the password for the Kamailio schema [default $MYSQL_KAM_DEF_PASSWORD]:\c"
read MYSQL_KAM_PASSWORD
<commit_msg>Correct reference to REQ_PYTHON_MAJOR_VER<commit_after>#!/bin/bash
# Uncomment if you want to debug this script.
#set -x

#Define some global variables

FLT_CARRIER=8
FLT_PBX=9
REQ_PYTHON_MAJOR_VER=3
SYSTEM_KAMAILIO_CONF_DIR=/etc/kamailio
DSIP_KAMAILIO_CONF_DIR=$(pwd)
DEBUG=0 # By default debugging is turned off, but can be enabled during startup by using "start -debug" parameters

#Default MYSQL install values

MYSQL_KAM_DEF_USERNAME=kamailio
MYSQL_KAM_DEF_PASSWORD="<PASSWORD>"
MYSQL_KAM_DEF_DATABASE="kamailio"

#Grab the port being using
DSIP_PORT=$(cat ${DSIP_KAMAILIO_CONF_DIR}/gui/settings.py | grep -oP 'DSIP_PORT=\K[0-9]*')

# Get Linux Distro

if [ -f /etc/redhat-release ]; then
 	DISTRO="centos"
    elif [ -f /etc/debian_version ]; then
	DISTRO="debian"
    fi  


# Uncomment and set this variable to an explicit Python executable file name
# If set, the script will not try and find a Python version with 3.5 as the major release number
#PYTHON_CMD=/usr/bin/python3.4

function isPythonInstalled {


possible_python_versions=`find / -name "python$REQ_PYTHON_MAJOR_VER*" -type f -executable  2>/dev/null`
for i in $possible_python_versions
do
    ver=`$i -V 2>&1`
    if [ $? -eq 0 ]; then  #Check if the version parameter is working correctly
    	echo $ver | grep $REQ_PYTHON_MAJOR_VER >/dev/null
    	if [ $? -eq 0 ]; then
        	PYTHON_CMD=$i
       		return
    	fi
    fi
done

#Required version of Python is not found.  So, tell the user to install the required version
echo -e "\nPlease install at least python version $REQ_PYTHON_MAJOR_VER\n"
exit

}

function configureKamailio {

echo -e "[Database Configuration]\n"
echo -e "Please enter the username for the Kamailio schema [default $MYSQL_KAM_DEF_USERNAME]:\c"
read MYSQL_KAM_USERNAME

echo -e "Please enter the password for the Kamailio schema [default $MYSQL_KAM_DEF_PASSWORD]:\c"
read MYSQL_KAM_PASSWORD

{'fraction_non_alphanumeric': 0.08858057630736393, 'fraction_numerical': 0.0080042689434365, 'mean_word_length': 4.34045584045584, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1916304', 'n_tokens_mistral': 1390, 'n_tokens_neox': 1354, 'n_words': 411}