Minor Fixes

This commit is contained in:
earnolmartin 2020-03-25 22:34:33 -06:00
parent 48d45765e2
commit 6ecdd7c083
2 changed files with 17 additions and 10 deletions

View file

@ -1396,12 +1396,16 @@ function CheckPreReqs(){
function installPHPFPM(){ function installPHPFPM(){
aptgetInstall php5-fpm aptgetInstall php5-fpm
aptgetInstall php-fpm aptgetInstall php-fpm
countOfPHPFPM=$(apt-cache search "fpm" | grep "php" | grep "\-fpm" | awk '{print $1}' | wc -l)
if [ "$countOfPHPFPM" -le "2" ]; then
phpfpmversionsFromCache=$(apt-cache search "fpm" | grep "php" | grep "\-fpm" | head -n 2 | awk '{print $1}') phpfpmversionsFromCache=$(apt-cache search "fpm" | grep "php" | grep "\-fpm" | head -n 2 | awk '{print $1}')
for version in "$phpfpmversionsFromCache" ; do for version in "$phpfpmversionsFromCache" ; do
if [ ! -z "$version" ]; then if [ ! -z "$version" ]; then
aptgetInstall "$version" aptgetInstall "$version"
fi fi
done done
fi
} }
function addConfDFolder(){ function addConfDFolder(){

View file

@ -1251,11 +1251,14 @@ function install_nginx_webserver(){
aptget(array('nginx','php5-fpm','php-fpm','php5-cgi','php-cgi')); # apt-get install nginx php5-fpm php5-cgi aptget(array('nginx','php5-fpm','php-fpm','php5-cgi','php-cgi')); # apt-get install nginx php5-fpm php5-cgi
// Detect php-fpm specific verison in case above fails // Detect php-fpm specific verison in case above fails
$numPHPFPMVersions = trim(shell_exec("apt-cache search 'fpm' | grep 'php' | grep '\-fpm' | awk '{print \$1}' | wc -l"));
if(!empty($numPHPFPMVersions) && is_numeric($numPHPFPMVersions) && intval($numPHPFPMVersions) <= 2){
$phpFPMVersions = shell_exec("apt-cache search 'fpm' | grep 'php' | grep '\-fpm' | head -n 2 | awk '{print \$1}'"); $phpFPMVersions = shell_exec("apt-cache search 'fpm' | grep 'php' | grep '\-fpm' | head -n 2 | awk '{print \$1}'");
$arrayOfPHPFPM = array_filter(explode(PHP_EOL, $phpFPMVersions)); $arrayOfPHPFPM = array_filter(explode(PHP_EOL, $phpFPMVersions));
if(isset($arrayOfPHPFPM) && is_array($arrayOfPHPFPM) && count($arrayOfPHPFPM)){ if(isset($arrayOfPHPFPM) && is_array($arrayOfPHPFPM) && count($arrayOfPHPFPM)){
aptget($arrayOfPHPFPM); aptget($arrayOfPHPFPM);
} }
}
copy("$mydir/etc/nginx/mime.types","/etc/nginx/mime.types"); copy("$mydir/etc/nginx/mime.types","/etc/nginx/mime.types");