|
11 | 11 | source /usr/local/bin/enginescript/enginescript-variables.txt |
12 | 12 | source /home/EngineScript/enginescript-install-options.txt |
13 | 13 |
|
| 14 | +# Source shared functions library |
| 15 | +source /usr/local/bin/enginescript/scripts/functions/shared/enginescript-common.sh |
14 | 16 |
|
15 | 17 |
|
| 18 | + |
| 19 | +#---------------------------------------------------------------------------------- |
| 20 | +# Start Main Script |
| 21 | + |
16 | 22 | # --- Define Fixed Import Paths (Needed for instructions) --- |
17 | 23 | IMPORT_BASE_DIR="/home/EngineScript/temp/site-import" |
18 | 24 | # Directories for the original two-file method (keep variable names consistent) |
@@ -55,16 +61,12 @@ echo "---------------------------------------------------------------------" |
55 | 61 | read -p "Press [Enter] to continue once the file(s) are prepared..." |
56 | 62 | # --- End Instructions --- |
57 | 63 |
|
58 | | - |
59 | | -#---------------------------------------------------------------------------------- |
60 | | -# Start Main Script |
61 | | - |
62 | 64 | # Check if services are running |
63 | 65 | echo -e "\n\n${BOLD}Running Services Check:${NORMAL}\n" |
64 | 66 |
|
65 | 67 | # MariaDB Service Check |
66 | 68 | STATUS="$(systemctl is-active mariadb)" |
67 | | -if [ "${STATUS}" = "active" ]; then |
| 69 | +if [[ "${STATUS}" == "active" ]]; then |
68 | 70 | echo "PASSED: MariaDB is running." |
69 | 71 | else |
70 | 72 | echo "FAILED: MariaDB not running. Please diagnose this issue before proceeding." |
|
73 | 75 |
|
74 | 76 | # Nginx Service Check |
75 | 77 | STATUS="$(systemctl is-active nginx)" |
76 | | -if [ "${STATUS}" = "active" ]; then |
| 78 | +if [[ "${STATUS}" == "active" ]]; then |
77 | 79 | echo "PASSED: Nginx is running." |
78 | 80 | else |
79 | 81 | echo "FAILED: Nginx not running. Please diagnose this issue before proceeding." |
|
82 | 84 |
|
83 | 85 | # PHP Service Check |
84 | 86 | STATUS="$(systemctl is-active "php${PHP_VER}-fpm")" |
85 | | -if [ "${STATUS}" = "active" ]; then |
| 87 | +if [[ "${STATUS}" == "active" ]]; then |
86 | 88 | echo "PASSED: PHP ${PHP_VER} is running." |
87 | 89 | else |
88 | 90 | echo "FAILED: PHP ${PHP_VER} not running. Please diagnose this issue before proceeding." |
|
91 | 93 |
|
92 | 94 | # Redis Service Check |
93 | 95 | STATUS="$(systemctl is-active redis)" |
94 | | -if [ "${STATUS}" = "active" ]; then |
| 96 | +if [[ "${STATUS}" == "active" ]]; then |
95 | 97 | echo "PASSED: Redis is running." |
96 | 98 | else |
97 | 99 | echo "FAILED: Redis not running. Please diagnose this issue before proceeding." |
@@ -958,7 +960,7 @@ if [ "${#SITES[@]}" = 1 ]; |
958 | 960 | # Check if redis.conf needs update (avoid duplicate changes) |
959 | 961 | if ! grep -q "databases ${#SITES[@]}" /etc/redis/redis.conf; then |
960 | 962 | sed -i "s|databases ${OLDREDISDB}|databases ${#SITES[@]}|g" /etc/redis/redis.conf |
961 | | - service redis-server restart |
| 963 | + restart_service "redis-server" |
962 | 964 | fi |
963 | 965 | # Set WordPress to use the latest Redis database number. |
964 | 966 | sed -i "s|WP_REDIS_DATABASE', 0|WP_REDIS_DATABASE', ${OLDREDISDB}|g" "${TARGET_WP_PATH}/wp-config.php" |
|
0 commit comments