File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -289,7 +289,6 @@ if [ "${MARIADB}" = 1 ];
289289 echo " MARIADB script has already run."
290290 else
291291 /usr/local/bin/enginescript/scripts/install/mariadb/mariadb-install.sh
292- echo " MARIADB=1" >> /home/EngineScript/install-log.txt
293292fi
294293
295294# PHP
@@ -298,7 +297,6 @@ if [ "${PHP}" = 1 ];
298297 echo " PHP script has already run."
299298 else
300299 /usr/local/bin/enginescript/scripts/install/php/php-install.sh
301- echo " PHP=1" >> /home/EngineScript/install-log.txt
302300fi
303301
304302# Redis
@@ -307,7 +305,6 @@ if [ "${REDIS}" = 1 ];
307305 echo " REDIS script has already run."
308306 else
309307 /usr/local/bin/enginescript/scripts/install/redis/redis-install.sh
310- echo " REDIS=1" >> /home/EngineScript/install-log.txt
311308fi
312309
313310# Nginx
@@ -316,7 +313,6 @@ if [ "${NGINX}" = 1 ];
316313 echo " NGINX script has already run."
317314 else
318315 /usr/local/bin/enginescript/scripts/install/nginx/nginx-install.sh
319- echo " NGINX=1" >> /home/EngineScript/install-log.txt
320316fi
321317
322318# Tools
Original file line number Diff line number Diff line change @@ -102,6 +102,26 @@ sed -i "s|SEDMYSQL45PERCENT|${SERVER_MEMORY_TOTAL_45}|g" /etc/mysql/mariadb.cnf
102102sed -i " s|SEDMYSQL80PERCENT|${SERVER_MEMORY_TOTAL_80} |g" /etc/mysql/mariadb.cnf
103103systemctl start mariadb.service
104104
105+ # Check if services are running
106+ # MariaDB Service Check
107+ STATUS=" $( systemctl is-active mariadb) "
108+ if [ " ${STATUS} " = " active" ]; then
109+ echo " MariaDB is running. Continuing the installation process."
110+ else
111+ echo " MariaDB not running. Please diagnose this issue before proceeding"
112+ exit 1
113+ fi
114+
115+ # MySQL Service Check
116+ STATUS=" $( systemctl is-active mysql) "
117+ if [ " ${STATUS} " = " active" ]; then
118+ echo " MySQL is running. Continuing the installation process."
119+ echo " MARIADB=1" >> /home/EngineScript/install-log.txt
120+ else
121+ echo " MySQL not running. Please diagnose this issue before proceeding"
122+ exit 1
123+ fi
124+
105125echo " "
106126echo " ============================================================="
107127echo " "
Original file line number Diff line number Diff line change @@ -74,6 +74,16 @@ if [ "${SHOW_ENGINESCRIPT_HEADER}" = 1 ];
7474 echo " "
7575fi
7676
77+ # Nginx Service Check
78+ STATUS=" $( systemctl is-active nginx) "
79+ if [ " ${STATUS} " = " active" ]; then
80+ echo " Nginx is running. Continuing the installation process."
81+ echo " NGINX=1" >> /home/EngineScript/install-log.txt
82+ else
83+ echo " Nginx not running. Please diagnose this issue before proceeding"
84+ exit 1
85+ fi
86+
7787# Nginx Installation Completed
7888echo " "
7989echo " "
Original file line number Diff line number Diff line change @@ -68,6 +68,16 @@ chown -R www-data:www-data /etc/php
6868# Restart PHP
6969service php${PHP_VER} -fpm restart
7070
71+ # PHP Service Check
72+ STATUS=" $( systemctl is-active php${PHP_VER} -fpm) "
73+ if [ " ${STATUS} " = " active" ]; then
74+ echo " PHP ${PHP_VER} is running. Continuing the installation process."
75+ echo " PHP=1" >> /home/EngineScript/install-log.txt
76+ else
77+ echo " PHP ${PHP_VER} not running. Please diagnose this issue before proceeding"
78+ exit 1
79+ fi
80+
7181echo " "
7282echo " ============================================================="
7383echo " "
Original file line number Diff line number Diff line change @@ -47,3 +47,13 @@ chmod 775 /etc/redis/redis.conf
4747service redis-server restart
4848systemctl daemon-reload
4949sudo systemctl enable redis-server
50+
51+ # Redis Service Check
52+ STATUS=" $( systemctl is-active redis) "
53+ if [ " ${STATUS} " = " active" ]; then
54+ echo " Redis is running. Continuing the installation process."
55+ echo " REDIS=1" >> /home/EngineScript/install-log.txt
56+ else
57+ echo " Redis not running. Please diagnose this issue before proceeding"
58+ exit 1
59+ fi
Original file line number Diff line number Diff line change 2424# ----------------------------------------------------------------------------
2525# Start Main Script
2626
27+ # Check if services are running
28+ # MariaDB Service Check
29+ STATUS=" $( systemctl is-active mariadb) "
30+ if [ " ${STATUS} " = " active" ]; then
31+ echo " MariaDB is running. Continuing the installation process."
32+ else
33+ echo " MariaDB not running. Please diagnose this issue before proceeding"
34+ exit 1
35+ fi
36+
37+ # MySQL Service Check
38+ STATUS=" $( systemctl is-active mysql) "
39+ if [ " ${STATUS} " = " active" ]; then
40+ echo " MySQL is running. Continuing the installation process."
41+ else
42+ echo " MySQL not running. Please diagnose this issue before proceeding"
43+ exit 1
44+ fi
45+
46+ # Nginx Service Check
47+ STATUS=" $( systemctl is-active nginx) "
48+ if [ " ${STATUS} " = " active" ]; then
49+ echo " Nginx is running. Continuing the installation process."
50+ else
51+ echo " Nginx not running. Please diagnose this issue before proceeding"
52+ exit 1
53+ fi
54+
55+ # PHP Service Check
56+ STATUS=" $( systemctl is-active php${PHP_VER} -fpm) "
57+ if [ " ${STATUS} " = " active" ]; then
58+ echo " PHP ${PHP_VER} is running. Continuing the installation process."
59+ else
60+ echo " PHP ${PHP_VER} not running. Please diagnose this issue before proceeding"
61+ exit 1
62+ fi
63+
64+ # Redis Service Check
65+ STATUS=" $( systemctl is-active redis) "
66+ if [ " ${STATUS} " = " active" ]; then
67+ echo " Redis is running. Continuing the installation process."
68+ else
69+ echo " Redis not running. Please diagnose this issue before proceeding"
70+ exit 1
71+ fi
72+
2773# Intro Warning
2874echo " "
2975echo " -==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-"
You can’t perform that action at this time.
0 commit comments