Skip to content

Commit f48d5ac

Browse files
committed
Added MySQLTuner and MariaDB-Check
Also fixed wp-cli doctor configuration bug.
1 parent 8a519a6 commit f48d5ac

5 files changed

Lines changed: 83 additions & 6 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
#----------------------------------------------------------------------------
3+
# EngineScript - A High-Performance WordPress Server Built on Ubuntu and Cloudflare
4+
#----------------------------------------------------------------------------
5+
# Website: https://EngineScript.com
6+
# GitHub: https://github.com/Enginescript/EngineScript
7+
# Company: VisiStruct / EngineScript
8+
# License: GPL v3.0
9+
# OS: Ubuntu 22.04 (jammy)
10+
#----------------------------------------------------------------------------
11+
12+
# EngineScript Variables
13+
source /usr/local/bin/enginescript/enginescript-variables.txt
14+
source /home/EngineScript/enginescript-install-options.txt
15+
16+
# Check current user's ID. If user is not 0 (root), exit.
17+
if [ "${EUID}" != 0 ];
18+
then
19+
echo "${BOLD}ALERT:${NORMAL}"
20+
echo "EngineScript should be executed as the root user."
21+
exit
22+
fi
23+
24+
#----------------------------------------------------------------------------
25+
# Start Main Script
26+
27+
mariadb-check --auto-repair --check --flush --all-databases
28+
mariadb-check --auto-repair --check --flush --optimize --all-databases
29+
30+
# Ask user to acknowledge that the scan has completed before moving on
31+
echo ""
32+
echo ""
33+
read -n 1 -s -r -p "Press any key to continue"
34+
echo ""
35+
echo ""
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
#----------------------------------------------------------------------------
3+
# EngineScript - A High-Performance WordPress Server Built on Ubuntu and Cloudflare
4+
#----------------------------------------------------------------------------
5+
# Website: https://EngineScript.com
6+
# GitHub: https://github.com/Enginescript/EngineScript
7+
# Company: VisiStruct / EngineScript
8+
# License: GPL v3.0
9+
# OS: Ubuntu 22.04 (jammy)
10+
#----------------------------------------------------------------------------
11+
12+
# EngineScript Variables
13+
source /usr/local/bin/enginescript/enginescript-variables.txt
14+
source /home/EngineScript/enginescript-install-options.txt
15+
16+
# Check current user's ID. If user is not 0 (root), exit.
17+
if [ "${EUID}" != 0 ];
18+
then
19+
echo "${BOLD}ALERT:${NORMAL}"
20+
echo "EngineScript should be executed as the root user."
21+
exit
22+
fi
23+
24+
#----------------------------------------------------------------------------
25+
# Start Main Script
26+
27+
perl /usr/local/bin/mysqltuner/mysqltuner.pl
28+
29+
# Ask user to acknowledge that the scan has completed before moving on
30+
echo ""
31+
echo ""
32+
read -n 1 -s -r -p "Press any key to continue"
33+
echo ""
34+
echo ""

scripts/functions/server-tools/wp-cli-doctor.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ cd /var/www/sites
2828
printf "Please select the site you want to scan for issues\n"
2929
select d in *; do test -n "$d" && break; echo ">>> Invalid Selection"; done
3030
cd "$d"/html && echo "WP-CLI Doctor is running. Scan may take a bit, standby for results."
31-
wp doctor check --allow-root
31+
wp doctor check --all --allow-root
3232

3333
# Ask user to acknowledge that the scan has completed before moving on
3434
echo ""

scripts/menu/security-tools-menu.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ while true
3232
echo ""
3333
echo ""
3434
PS3='Please enter your choice: '
35-
secoptions=("10up WP-CLI Vulnerability Scan" "PHP Malware Finder" "Wordfence CLI Malware Scan" "WPScan Vulnerability Scan" "Exit Security Tools")
35+
secoptions=("10up WP-CLI Vulnerability Scan" "PHP Malware Finder" "Wordfence CLI Malware Scan" "WP-CLI Doctor" "WPScan Vulnerability Scan" "Exit Security Tools")
3636
select secopt in "${secoptions[@]}"
3737
do
3838
case $secopt in
@@ -48,6 +48,10 @@ while true
4848
/usr/local/bin/enginescript/scripts/functions/security/wordfence-cli.sh
4949
break
5050
;;
51+
"WP-CLI Doctor")
52+
/usr/local/bin/enginescript/scripts/functions/server-tools/wp-cli-doctor.sh
53+
break
54+
;;
5155
"WPScan Vulnerability Scan")
5256
/usr/local/bin/enginescript/scripts/functions/security/wpscan.sh
5357
break

scripts/menu/server-site-tools-menu.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ while true
4040
/usr/local/bin/enginescript/scripts/install/vhost/vhost-install.sh
4141
break
4242
;;
43+
"MariaDB-Check Database Optimizer")
44+
/usr/local/bin/enginescript/scripts/functions/server-tools/mariadbcheck.sh
45+
break
46+
;;
47+
"MySQLTuner")
48+
/usr/local/bin/enginescript/scripts/functions/server-tools/mysqltuner.sh
49+
break
50+
;;
4351
"Update Domain Vhost File")
4452
echo "Option coming soon"
4553
sleep 3
@@ -53,10 +61,6 @@ while true
5361
/usr/local/bin/enginescript/scripts/menu/logs-menu.sh
5462
break
5563
;;
56-
"WP-CLI Doctor")
57-
/usr/local/bin/enginescript/scripts/functions/server-tools/wp-cli-doctor.sh
58-
break
59-
;;
6064
"Remove Domain (DANGER)")
6165
/usr/local/bin/enginescript/scripts/install/vhost/vhost-remove.sh
6266
break

0 commit comments

Comments
 (0)