<commit_before>#!/bin/bash
#####################################################################
##
## Title: Patch Management Dashboard Installer
##
## Authors: jonsjava <<EMAIL>>
##          metalcated <<EMAIL>>
##
## Date: 11/22/2014
##
## Version: 0.7
##
## Changelog: 0.1 - Initial Release
##            0.2 - Improved base installer for OS detection
##            0.3 - Script rework/overhaul. Added sql insert secion
##                - Cleaned up and organized into functions
##            0.4 - Added crontab function rather than manual proc
##                - Lots of logic added to read the existing db users
##                - Check connections to the provided db info 
##                - Added virtualhost file to apache/httpd
##            0.5 - Fixed relative_path in rewrite check
##                - Added SQL fixes for existing table data
##            0.6 - Added automated Debian flavor apache/php/mysql
##                - Added automated Red Hat flavor apache/php/mysql
##                - Added PHP Version check and cleaned up some output
##            0.7 - Added installation key for agent authentication
##
######################################################################

# generate random passwords
function genPasswd()
{
	local p=$1
	[ "$p" == "" ] && p=12
	tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${p} | xargs
}

function genInstallKey()
{
	export installation_key=$(< /dev/urandom tr -dc 'a-zA-Z0-9~!@#$%^&*_-' | head -c${1:-32}|sha256sum)
}

# default admin and users for the admin web interface
# admin info
web_admin="pmdadmin"<commit_msg>Added a ton more logic and checks, php install for unsupported versions<commit_after>#!/bin/bash
#####################################################################
##
## Title: Patch Management Dashboard Installer
##
## Authors: jonsjava <<EMAIL>>
##          metalcated <<EMAIL>>
##
## Date: 11/22/2014
##
## Version: 0.7
##
## Changelog: 0.1 - Initial Release
##            0.2 - Improved base installer for OS detection
##            0.3 - Script rework/overhaul. Added sql insert secion
##                - Cleaned up and organized into functions
##            0.4 - Added crontab function rather than manual proc
##                - Lots of logic added to read the existing db users
##                - Check connections to the provided db info 
##                - Added virtualhost file to apache/httpd
##            0.5 - Fixed relative_path in rewrite check
##                - Added SQL fixes for existing table data
##            0.6 - Added automated Debian flavor apache/php/mysql
##                - Added automated Red Hat flavor apache/php/mysql
##                - Added PHP Version check and cleaned up some output
##            0.7 - Added installation key for agent authentication
##                - Added more logic for mysql root passwords
##                - Added php install for unsupported versions
##
######################################################################

# generate random passwords
function genPasswd()
{
	local p=$1
	[ "$p" == "" ] && p=12
	tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${p} | xargs
}

function genInstallKey()
{
	export installation_key=$(< /dev/urandom tr -dc 'a-zA-Z0-9~!@#$%^&*_-' | head -c${1:-32}|sha256sum)
}

# default admin and users for the admin web interface
# admin info
web_admin="pmdadmin"
{'fraction_non_alphanumeric': 0.18807749627421758, 'fraction_numerical': 0.022056631892697468, 'mean_word_length': 2.5513227513227514, 'pattern_counts': {'":': 0, '<': 15, '<?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': '3563725', 'n_tokens_mistral': 985, 'n_tokens_neox': 877, 'n_words': 321}