Fixes for AlpinePHPTool:

*Added crontab configuration to the script for FreshRSS and Nextcloud CT's
*Added ProxmoxUpdateScript configuration to the script for Nextcloud CT
This commit is contained in:
2025-01-16 23:54:55 +01:00
parent 5c663faa0d
commit 1d661b3287
7 changed files with 50 additions and 24 deletions

View File

@@ -101,6 +101,7 @@ run_Purge() {
OldPHPVer=$(grep php /etc/apk/world -m 1|sed -e "s/\-.*//" -e "s/php//")
#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
tar -czf "/opt/PHPCfgBackup/PHP$OldPHPVer-Config.tar.gz" -C "/etc/php$OldPHPVer" ./
rm -rf "/etc/php$OldPHPVer"
@@ -126,17 +127,36 @@ run_Install() {
#Unique settings for configuration
case $config in
nextcloud)
echo runnig distrobuilder
#Configure Php-Cli
sed -i '/memory_limit =/c\memory_limit = 512M' /etc/php$NewPHPVer/php.ini
echo "apc.enable_cli=1" >> /etc/php$NewPHPVer/php.ini
if [[ -f /opt/ProxMoxToolKitAppUpdate.sh ]]; then
sed -i "/CurPHP=/c\CurPHP=php$NewPHPVer" /opt/ProxMoxToolKitAppUpdate.sh
fi
;;
esac
#Configure Cron
if test -f $configStore/crontab; then
sed -i -e 's/PHPver/'$NewPHPVer'/g' $configStore/crontab
mv $configStore/crontab /etc/crontabs/nginx
fi
#Enable service(s) on boot
rc-update add php-fpm$NewPHPVer
}
run_DistrobuilderOnly() {
#Do things only required when setting up using distrobuilder
##Unique settings for configuration
case $config in
nextcloud)
sed -i -e "s/phpPHPver/php$NewPHPVer/g" /opt/Setup/Scripts/FirstRun.sh #Update FirstRun setup
sed -i -e "s/phpPHPver/php$NewPHPVer/g" /opt/Setup/Scripts/PTKAppUpdate.sh #Update nextcloud update script
;;
esac
}
fetch_Config() {
#Unique settings for configuration
case $config in
@@ -147,6 +167,11 @@ 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;
then
wget "$gitRepo"/raw/branch/"$gitBranch"/CT-Files/"$config"/Configs/crontab -O /tmp/crontab || echo_exit "ERROR: Config download failed"
fi
;;
esac
@@ -156,6 +181,7 @@ case $mode in
distrobuilder)
#Set config location
configStore=/opt/Setup/Configs
run_DistrobuilderOnly
run_Install
;;
fresh)