Skip to content

Commit 8677fed

Browse files
committed
Installation Checks
1 parent c3abd1e commit 8677fed

6 files changed

Lines changed: 96 additions & 4 deletions

File tree

enginescript-install.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff 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
293292
fi
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
302300
fi
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
311308
fi
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
320316
fi
321317

322318
# Tools

scripts/install/mariadb/mariadb-install.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,26 @@ sed -i "s|SEDMYSQL45PERCENT|${SERVER_MEMORY_TOTAL_45}|g" /etc/mysql/mariadb.cnf
102102
sed -i "s|SEDMYSQL80PERCENT|${SERVER_MEMORY_TOTAL_80}|g" /etc/mysql/mariadb.cnf
103103
systemctl 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+
105125
echo ""
106126
echo "============================================================="
107127
echo ""

scripts/install/nginx/nginx-install.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ if [ "${SHOW_ENGINESCRIPT_HEADER}" = 1 ];
7474
echo ""
7575
fi
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
7888
echo ""
7989
echo ""

scripts/install/php/php-install.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ chown -R www-data:www-data /etc/php
6868
# Restart PHP
6969
service 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+
7181
echo ""
7282
echo "============================================================="
7383
echo ""

scripts/install/redis/redis-install.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,13 @@ chmod 775 /etc/redis/redis.conf
4747
service redis-server restart
4848
systemctl daemon-reload
4949
sudo 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

scripts/install/vhost/vhost-install.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,52 @@ fi
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
2874
echo ""
2975
echo "-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-"

0 commit comments

Comments
 (0)