<commit_before>#!/bin/bash

# Installing minimum of python 2.7
_python_version=`python -c 'import sys; version=sys.version_info[:3]; print("{0}.{1}.{2}".format(*version))'`

read -r -d "" _PYTHON_HELP <<EOF

You are running an older version python ... \n \n

Please run the following commands to setup python27 \n \n

sudo yum update \n
sudo yum install centos-release-scl \n
sudo yum install python27 \n
scl enable python27 bash \n

EOF

if [ "$_python_version" == "2.6.6" ]
then
  echo -e $_PYTHON_HELP
  exit
fi


cd scripts/
sudo bash installessentials.sh
sudo bash libgit2-build.sh
bash osquery-build.sh
sudo bash pip-install.sh
sudo bash pyinstaller-hubble.sh pkg_clean
sudo bash pyinstaller-hubble.sh pkg_init
sudo bash pyinstaller-hubble.sh pkg_create<commit_msg>Check for root user run and exit the script, if the script is run as root user.<commit_after>#!/bin/bash

_user=`id -u`

# Installing minimum of python 2.7
_python_version=`python -c 'import sys; version=sys.version_info[:3]; print("{0}.{1}.{2}".format(*version))'`

read -r -d "" _PYTHON_HELP <<EOF

You are running an older version python ... \n \n

Please run the following commands to setup python27 \n \n

sudo yum update \n
sudo yum install centos-release-scl \n
sudo yum install python27 \n
scl enable python27 bash \n

EOF

# Check if the python version is 2.6.6
if [ "$_python_version" == "2.6.6" ]
then
  echo -e $_PYTHON_HELP
  exit
fi

# Check if the current user is root
if [ "$_user" == "0" ]
then
  echo "This script should not be run as root ..."
  echo "Please run this script as regular user with sudo privileges ..."
  echo "Exiting ..."
  exit
fi

cd scripts/
sudo bash installessentials.sh
sudo bash libgit2-build.sh
bash osquery-build.sh
sudo bash pip-install.sh
sudo bash pyinstaller-hubble.sh pkg_clean
sudo bash pyinstaller-hubble.sh pkg_init
sudo bash pyinstaller-hubble.sh pkg_create
{'fraction_non_alphanumeric': 0.10738968633705476, 'fraction_numerical': 0.019138755980861243, 'mean_word_length': 3.863049095607235, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '7502509', 'n_tokens_mistral': 712, 'n_tokens_neox': 649, 'n_words': 239}