Files
VPS-scripts_Web-V2/SubModules/php-fpm/preconf.sh

39 lines
1.6 KiB
Bash

if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] ; then
# Debian/Ubunbtu Php variables
phpPoolDir=/etc/php/${phpver}/fpm/pool.d
phpPkgName=php${phpver}
phpMainConf=/etc/php/${phpver}/fpm/php.ini
phpFPMService=php${phpver}-fpm
elif [ "$shortdist" = "el8" ]; then
# Centos Php variable
phpPoolDir=/etc/opt/remi/php${phpver//.}/php-fpm.d/
phpPkgName=php${phpver//.}-php
phpMainConf=/etc/opt/remi/php${phpver//.}/php.ini
phpFPMService=php${phpver//.}-php-fpm
#Creating Socket directory
mkdir -p /var/run/php
fi
#Setting php version branch
if [ ${phpver//.} -ge 70 ] && [ ${phpver//.} -lt 80 ] ; then
phpVerBranch=7x
elif [ ${phpver//.} -ge 80 ] && [ ${phpver//.} -lt 90 ]; then
phpVerBranch=8x
fi
#Getting php pkglist
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/php-fpm/php"$phpVerBranch"/generic.php.pkg.list; then
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/php-fpm/generic.phppkg.list
printf " " >>/tmp/pkg.list
fi
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/php-fpm/php"$phpVerBranch"/"$PKGLIST".php.pkg.list; then
curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/php-fpm/php"$phpVerBranch"/"$PKGLIST".php.pkg.list
printf " " >>/tmp/pkg.list
fi
#Storing vars to config
for storeme in phpPoolDir phpPkgName phpMainConf phpFPMService phpVerBranch; do
declare -p $storeme | cut -d ' ' -f 3- >> /etc/ICTM/phpvar.list
done