Files
VPS-scripts_Web-V2/SubModules/php-fpm/preconf.sh
Bram Prieshof 6922ea61b2 Update references to new git location
Changed Web-V2 config location to /etc/WebV2
2023-07-02 20:43:33 +02:00

39 lines
1.7 KiB
Bash

if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] || [ "$shortdist" = "deb11" ] ; 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 /var/lib/php/sessions
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/php"$phpVerBranch"/generic.php.pkg.list >>/tmp/pkg.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 >>/tmp/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/WebV2/phpvar.list
done