<commit_before>#!/bin/bash
#######################################################
## NGINX + PHP + MariaDB Installer for Ubuntu/Debian ##
## By. previrtu (<EMAIL>)                  ##
#######################################################
if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root :(" 
   exit 1
fi

OS=$(awk '/DISTRIB_ID=/' /etc/*-release | sed 's/DISTRIB_ID=//' | tr '[:upper:]' '[:lower:]')
NGINX_PPA=0
MARIADB_VER="5.5"
if [ "$OS" != "ubuntu" ] && [ "$OS" != "debian" ]; then
	echo "this script is only executable from Ubuntu/Debian."
	exit
fi

function apt_cache_update {
	echo "# Updating APT(Advanced Packaging Tool) cache"
	./test.sh > /dev/null
	apt-get update > /dev/null
}

function select_nginx {
		echo ""
		echo "# Select NGINX PPA(Personal Package Archives)"
		echo "	1) Stable"
		echo "	2) Development"
		echo -n "Enter: "
		read NGINX_PPA
		if [ "$NGINX_PPA" != 1 ] && [ "$NGINX_PPA" != 2 ]; then
			select_nginx
		fi
}

function select_mariadb {
	echo ""
	echo "# Select MariaDB version"
	echo "	1) 5.5 Stable"
	echo "	2) 10.0 Alpha"
	echo -n "Enter: "
	read MARIADB_SELECT
	if [ "$MARIADB_SELECT" != 1 ] && [ "$MARIADB_SELECT" != 2 ]; then
		select_mariadb
	elif [ "$MARIADB_SELECT" == 1 ]; then
		MARIADB_VER="5.5"
	elif [ "$MARIADB_SELECT" == 2 ]; then
		MARIADB_VER="10.0"
	fi
}

function func_install {
	echo -n "Are you sure want to continue? (y/n): "
	read YN 
	YN=`echo $YN | tr "[:lower:]" "[:upper:]"`
	if [ "$YN" != "Y" ] && [ "$YN" != "N" ]; then
		func_install
	elif [ "$YN" == "N" ]; then
		exit
	fi
}

function check_py_apt {
	if [ -f /usr/bin/add-apt-repository ]; then
		echo "- add-apt-repository: exist"
	else
		echo "- add-apt-repository: not exist"
		echo "# INSTALLING PYTHON-SOFTWARE-PROPERTIES"
		apt-get install python-software-properties -y
	fi
}

function install_nginx {
	echo "# INSTALLING NGINX"
	
	[ "$NGINX_PPA" == 2 ] & NGINX_LW="stable" || NGINX_LW="development"
	<commit_msg>Bug fix<commit_after>#!/bin/bash
#######################################################
## NGINX + PHP + MariaDB Installer for Ubuntu/Debian ##
## By. previrtu (<EMAIL>)                  ##
#######################################################
if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root :(" 
   exit 1
fi

OS=$(awk '/DISTRIB_ID=/' /etc/*-release | sed 's/DISTRIB_ID=//' | tr '[:upper:]' '[:lower:]')
NGINX_PPA=0
MARIADB_VER="5.5"
if [ "$OS" != "ubuntu" ] && [ "$OS" != "debian" ]; then
	echo "this script is only executable from Ubuntu/Debian."
	exit
fi

function apt_cache_update {
	echo "# Updating APT(Advanced Packaging Tool) cache"
	./test.sh > /dev/null
	apt-get update > /dev/null
}

function select_nginx {
		echo ""
		echo "# Select NGINX PPA(Personal Package Archives)"
		echo "	1) Stable"
		echo "	2) Development"
		echo -n "Enter: "
		read NGINX_PPA
		if [ "$NGINX_PPA" != 1 ] && [ "$NGINX_PPA" != 2 ]; then
			select_nginx
		fi
}

function select_mariadb {
	echo ""
	echo "# Select MariaDB version"
	echo "	1) 5.5 Stable"
	echo "	2) 10.0 Alpha"
	echo -n "Enter: "
	read MARIADB_SELECT
	if [ "$MARIADB_SELECT" != 1 ] && [ "$MARIADB_SELECT" != 2 ]; then
		select_mariadb
	elif [ "$MARIADB_SELECT" == 1 ]; then
		MARIADB_VER="5.5"
	elif [ "$MARIADB_SELECT" == 2 ]; then
		MARIADB_VER="10.0"
	fi
}

function func_install {
	echo -n "Are you sure want to continue? (y/n): "
	read YN 
	YN=`echo $YN | tr "[:lower:]" "[:upper:]"`
	if [ "$YN" != "Y" ] && [ "$YN" != "N" ]; then
		func_install
	elif [ "$YN" == "N" ]; then
		exit
	fi
}

function check_py_apt {
	if [ -f /usr/bin/add-apt-repository ]; then
		echo "- add-apt-repository: exist"
	else
		echo "- add-apt-repository: not exist"
		echo "# INSTALLING PYTHON-SOFTWARE-PROPERTIES"
		apt-get install python-software-properties -y
	fi
}

function install_nginx {
	echo "# INSTALLING NGINX"
	
	[ "$NGINX_PPA" == 2 ] && NGINX_LW="stable" || NGINX_LW="development"
	
{'fraction_non_alphanumeric': 0.22037368825185563, 'fraction_numerical': 0.013309444586639366, 'mean_word_length': 3.554778554778555, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1633215', 'n_tokens_mistral': 1661, 'n_tokens_neox': 1514, 'n_words': 387}