Merge Dev to Main (Alpine 1.21 update) #5

Merged
brammp merged 9 commits from dev into main 2025-01-17 22:39:18 +01:00
Showing only changes of commit 41dea36a0b - Show all commits

View File

@@ -95,10 +95,10 @@ fi
#Backup PHP config and purge PHP packages
run_Purge() {
#Check if PHP is installed
if ! command -v php &> /dev/null; then printf "ERROR: PHP is not installed\n\n"; exit 1;fi
#Get current PHP Version
OldPHPVer=$(grep php /etc/apk/world -m 1|sed -e "s/\-.*//" -e "s/php//")
#Check if PHP is installed
if ! command -v php$OldPHPVer &> /dev/null; then printf "ERROR: PHP is not installed\n\n"; exit 1;fi
#Create Backup an its location
if [[ ! -d "/opt/PHPCfgBackup/" ]];then mkdir -p "/opt/PHPCfgBackup"; fi
if [[ -f /etc/crontabs/nginx ]]; then cp /etc/crontabs/nginx /opt/PHPCfgBackup/crontabs-nginx; fi
@@ -106,7 +106,7 @@ run_Purge() {
rm -rf "/etc/php$OldPHPVer"
#Set placeholder in Nginx for PHP Socket
sed -i -e 's/'$OldPHPVer'/PHPver/g' /etc/nginx/nginx.conf
sed -i "/fastcgi_pass unix:\/run\/php-/c\ \ fastcgi_pass unix:\/run\/php-fpmPHPver\/php-fpm.sock;" /etc/nginx/nginx.conf
#Purge PHP packages
apk del php*
}
@@ -122,7 +122,7 @@ run_Install() {
printf "[Date]\ndate.timezone = Europe/Amsterdam" >/etc/php$NewPHPVer/conf.d/04_date_timezone.ini
#Configure Nginx PHP Socket
sed -i -e 's/PHPver/'$NewPHPVer'/g' /etc/nginx/nginx.conf
sed -i "/fastcgi_pass unix:\/run\/php-/c\ \ fastcgi_pass unix:\/run\/php-fpm$NewPHPVer\/php-fpm.sock;" /etc/nginx/nginx.conf
#Unique settings for configuration
case $config in
@@ -168,7 +168,7 @@ fetch_Config() {
wget "$gitRepo"/raw/branch/"$gitBranch"/CT-Files/$config/Configs/php.conf -O /tmp/php.conf || echo_exit "ERROR: Config download failed"
wget "$gitRepo"/raw/branch/"$gitBranch"/CT-Files/"$config"/Configs/php.pkglist -O /tmp/php.pkglist || echo_exit "ERROR: Config download failed"
#Check if crontab conf exists,if so get it
if wget -q --method=HEAD "$gitRepo"/raw/branch/"$gitBranch"/CT-Files/$config/Configs/crontab;
if wget -q --spider "$gitRepo"/raw/branch/"$gitBranch"/CT-Files/$config/Configs/crontab 2>/dev/null;
then
wget "$gitRepo"/raw/branch/"$gitBranch"/CT-Files/"$config"/Configs/crontab -O /tmp/crontab || echo_exit "ERROR: Config download failed"
fi