Added alternative php. Part 8

This commit is contained in:
Alexey Berezhok
2025-01-22 23:10:51 +03:00
parent b29a369515
commit c25c8d8f64
17 changed files with 181 additions and 67 deletions

View File

@@ -32,6 +32,10 @@ is_format_valid 'service' 'restart'
# Action #
#----------------------------------------------------------#
if [ "$service" == "apache2" ]; then
service="httpd"
fi
log="/dev/null"
if [ "$DEBUG_MODE" = "true" ]; then
@@ -49,13 +53,21 @@ if [ "$service" = "php-fpm" ]; then
php_versions=$($BIN/v-list-sys-php plain)
# Substitute php-fpm service name formats
for version in $php_versions; do
service_list="${service_list} php${version}-fpm"
if [ "$LOCAL_PHP" == "yes" ]; then
service_list="${service_list} brepo-php-fpm${version}"
else
service_list="${service_list} php${version}-php-fpm"
fi
done
else
service_list="$service"
fi
for service in $service_list; do
is_fpm="no"
if [[ "$service" =~ ^php[0-9.]+-php-fpm ]] || [[ "$service" =~ brepo-php-fpm[0-9.]+ ]]; then
is_fpm="yes"
fi
if [ "$service" = "iptables" ]; then
# Run the restart rules for iptables firewall
$BIN/v-stop-firewall
@@ -64,21 +76,13 @@ for service in $service_list; do
service $service upgrade >> $log 2>&1
elif [ -z "$restart" -o "$restart" = "no" ] && [ \
"$service" = "nginx" -o \
"$service" = "apache2" -o \
"$service" = "httpd" -o \
"$service" = "exim4" -o \
"$service" = "dovecot" -o \
"$service" = "bind9" -o \
"$service" = "named" -o \
"$service" = "vsftpd" -o \
"$service" = "php5.6-fpm" -o \
"$service" = "php7.0-fpm" -o \
"$service" = "php7.1-fpm" -o \
"$service" = "php7.2-fpm" -o \
"$service" = "php7.3-fpm" -o \
"$service" = "php7.4-fpm" -o \
"$service" = "php8.0-fpm" -o \
"$service" = "php8.1-fpm" -o \
"$service" = "php8.2-fpm" -o \
"$is_fpm" = "yes" -o \
"$service" = "proftpd" -o \
"$service" = "ssh" -o \
"$service" = "fail2ban" ]; then