|
6 | 6 | # |
7 | 7 | # This function reloads backend server configuration. |
8 | 8 |
|
| 9 | +restart=$1 |
| 10 | +# For backward compatibility might change in the feature |
| 11 | +version=$2 |
| 12 | + |
9 | 13 | #----------------------------------------------------------# |
10 | 14 | # Variables & Functions # |
11 | 15 | #----------------------------------------------------------# |
@@ -47,20 +51,30 @@ if [ "$1" = 'scheduled' ] || [ -z "$1" ] && [ "$SCHEDULED_RESTART" = 'yes' ]; th |
47 | 51 | fi |
48 | 52 |
|
49 | 53 | tmpfile=$(mktemp) |
50 | | -# Substitute php-fpm service name formats |
51 | | -for version in $($BIN/v-list-sys-php plain); do |
52 | | - v_php="php$version-fpm" |
53 | | - if [ ! -f "/etc/php/${version}/fpm/pool.d/dummy.conf" ]; then |
54 | | - cp -f "$HESTIA_INSTALL_DIR/php-fpm/dummy.conf" "/etc/php/${version}/fpm/pool.d/" |
55 | | - sed -i "s/9999/99${version//.}/g" "/etc/php/${version}/fpm/pool.d/dummy.conf" |
56 | | - fi |
57 | 54 |
|
58 | | - $BIN/v-restart-service "$v_php" "$1" >> $tmpfile 2>&1 |
| 55 | +if [ -z "$version" ]; then |
| 56 | + # Substitute php-fpm service name formats |
| 57 | + for version in $($BIN/v-list-sys-php plain); do |
| 58 | + v_php="php$version-fpm" |
| 59 | + if [ ! -f "/etc/php/${version}/fpm/pool.d/dummy.conf" ]; then |
| 60 | + cp -f "$HESTIA_INSTALL_DIR/php-fpm/dummy.conf" "/etc/php/${version}/fpm/pool.d/" |
| 61 | + sed -i "s/9999/99${version//.}/g" "/etc/php/${version}/fpm/pool.d/dummy.conf" |
| 62 | + fi |
| 63 | + |
| 64 | + $BIN/v-restart-service "$v_php" "$restart" |
| 65 | + if [ $? -ne 0 ]; then |
| 66 | + send_email_report |
| 67 | + check_result "$E_RESTART" "$v_php restart failed" |
| 68 | + fi |
| 69 | + done |
| 70 | +else |
| 71 | + v_php="php$version-fpm" |
| 72 | + $BIN/v-restart-service "$v_php" "$restart" |
59 | 73 | if [ $? -ne 0 ]; then |
60 | 74 | send_email_report |
61 | 75 | check_result "$E_RESTART" "$v_php restart failed" |
62 | 76 | fi |
63 | | -done |
| 77 | +fi |
64 | 78 |
|
65 | 79 | # Update restart queue |
66 | 80 | if [ -e "$HESTIA/data/queue/restart.pipe" ]; then |
|
0 commit comments