More fixes for AlpinePHPTool, Fixes for CT Nextcloud:
* Fixed not Stoping/Starting php-fpm services on upgrade and install * Fixed PHP detection by checking if php or php-fpm exists CT Nextcloud: added missing php-Phar package, fixed typo in FirstRun.sh
This commit is contained in:
@@ -1 +1 @@
|
|||||||
phpPHPver-pdo_mysql phpPHPver-pecl-imagick phpPHPver-cli phpPHPver-pecl-apcu phpPHPver-pecl-redis phpPHPver-fpm phpPHPver-cgi phpPHPver-common phpPHPver-mbstring phpPHPver-curl phpPHPver-gd phpPHPver-intl phpPHPver-soap phpPHPver-xml phpPHPver-zip phpPHPver-pear phpPHPver-session phpPHPver-posix phpPHPver-pdo phpPHPver-dom phpPHPver-simplexml phpPHPver-xmlreader phpPHPver-xmlwriter phpPHPver-opcache phpPHPver-pcntl phpPHPver-fileinfo phpPHPver-bcmath phpPHPver-gmp phpPHPver-sysvsem phpPHPver-exif phpPHPver-bz2 phpPHPver-sodium phpPHPver-ctype
|
phpPHPver-pdo_mysql phpPHPver-pecl-imagick phpPHPver-cli phpPHPver-pecl-apcu phpPHPver-pecl-redis phpPHPver-fpm phpPHPver-cgi phpPHPver-common phpPHPver-mbstring phpPHPver-curl phpPHPver-gd phpPHPver-intl phpPHPver-soap phpPHPver-xml phpPHPver-zip phpPHPver-pear phpPHPver-session phpPHPver-posix phpPHPver-pdo phpPHPver-dom phpPHPver-simplexml phpPHPver-xmlreader phpPHPver-xmlwriter phpPHPver-opcache phpPHPver-pcntl phpPHPver-fileinfo phpPHPver-bcmath phpPHPver-gmp phpPHPver-sysvsem phpPHPver-exif phpPHPver-bz2 phpPHPver-sodium phpPHPver-ctype phpPHPver-phar
|
||||||
@@ -40,4 +40,4 @@ sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set trusted_domains 1 -
|
|||||||
sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set overwrite.cli.url --value="$NextcloudWebProto://$(ifconfig | grep -A 1 'eth0' | tail -1 | cut -d ':' -f 2 | cut -d ' ' -f 1)"
|
sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set overwrite.cli.url --value="$NextcloudWebProto://$(ifconfig | grep -A 1 'eth0' | tail -1 | cut -d ':' -f 2 | cut -d ' ' -f 1)"
|
||||||
sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set overwriteprotocol --value="$NextcloudWebProto"
|
sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set overwriteprotocol --value="$NextcloudWebProto"
|
||||||
sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set maintenance_window_start --type=integer --value=2
|
sudo -u nginx phpPHPver /opt/nextcloud/occ config:system:set maintenance_window_start --type=integer --value=2
|
||||||
sudo -u nginx phpPHPver /opt/nextcloud/occ occ maintenance:repair --include-expensive
|
sudo -u nginx phpPHPver /opt/nextcloud/occ maintenance:repair --include-expensive
|
||||||
@@ -98,17 +98,22 @@ run_Purge() {
|
|||||||
#Get current PHP Version
|
#Get current PHP Version
|
||||||
OldPHPVer=$(grep php /etc/apk/world -m 1|sed -e "s/\-.*//" -e "s/php//")
|
OldPHPVer=$(grep php /etc/apk/world -m 1|sed -e "s/\-.*//" -e "s/php//")
|
||||||
#Check if PHP is installed
|
#Check if PHP is installed
|
||||||
if ! command -v php$OldPHPVer &> /dev/null; then printf "ERROR: PHP is not installed\n\n"; exit 1;fi
|
PHPInstalled=false
|
||||||
|
if command -v php$OldPHPVer &> /dev/null; then PHPInstalled=true;fi
|
||||||
|
if command -v php-fpm$OldPHPVer &> /dev/null; then PHPInstalled=true;fi
|
||||||
|
if ! $PHPInstalled; then printf "ERROR: PHP is not installed\n\n"; exit 1;fi
|
||||||
#Create Backup an its location
|
#Create Backup an its location
|
||||||
if [[ ! -d "/opt/PHPCfgBackup/" ]];then mkdir -p "/opt/PHPCfgBackup"; fi
|
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
|
if [[ -f /etc/crontabs/nginx ]]; then cp /etc/crontabs/nginx /opt/PHPCfgBackup/crontabs-nginx; fi
|
||||||
|
service php-fpm$OldPHPVer stop
|
||||||
|
rc-update del php-fpm$OldPHPVer
|
||||||
tar -czf "/opt/PHPCfgBackup/PHP$OldPHPVer-Config.tar.gz" -C "/etc/php$OldPHPVer" ./
|
tar -czf "/opt/PHPCfgBackup/PHP$OldPHPVer-Config.tar.gz" -C "/etc/php$OldPHPVer" ./
|
||||||
rm -rf "/etc/php$OldPHPVer"
|
rm -rf "/etc/php$OldPHPVer"
|
||||||
|
|
||||||
#Set placeholder in Nginx for PHP Socket
|
#Set placeholder in Nginx for PHP Socket
|
||||||
sed -i "/fastcgi_pass unix:\/run\/php-/c\ \ fastcgi_pass unix:\/run\/php-fpmPHPver\/php-fpm.sock;" /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
|
#Purge PHP packages
|
||||||
apk del php*
|
apk del "php*"
|
||||||
}
|
}
|
||||||
|
|
||||||
#(re)install PHP packages
|
#(re)install PHP packages
|
||||||
@@ -177,6 +182,11 @@ fetch_Config() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
start_Services(){
|
||||||
|
service php-fpm$NewPHPVer start
|
||||||
|
service nginx restart
|
||||||
|
}
|
||||||
|
|
||||||
case $mode in
|
case $mode in
|
||||||
distrobuilder)
|
distrobuilder)
|
||||||
#Set config location
|
#Set config location
|
||||||
@@ -184,11 +194,12 @@ case $mode in
|
|||||||
run_DistrobuilderOnly
|
run_DistrobuilderOnly
|
||||||
run_Install
|
run_Install
|
||||||
;;
|
;;
|
||||||
fresh)
|
fresh)
|
||||||
fetch_Config
|
|
||||||
#Set config location
|
#Set config location
|
||||||
configStore=/tmp
|
configStore=/tmp
|
||||||
|
fetch_Config
|
||||||
run_Install
|
run_Install
|
||||||
|
start_Services
|
||||||
;;
|
;;
|
||||||
purge)
|
purge)
|
||||||
run_Purge
|
run_Purge
|
||||||
@@ -200,6 +211,6 @@ case $mode in
|
|||||||
service nginx stop
|
service nginx stop
|
||||||
run_Purge
|
run_Purge
|
||||||
run_Install
|
run_Install
|
||||||
service nginx start
|
start_Services
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
Reference in New Issue
Block a user