Skip to content

Commit eccf902

Browse files
committed
Added graceful handling of missing tools
1 parent eb18816 commit eccf902

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

mysqlmonitor.sh

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
#!/bin/bash
22
# MySQL Monitor Script
33

4+
# Check for required tools
5+
for tool in mysqladmin awk bc; do
6+
if ! command -v "$tool" &> /dev/null; then
7+
echo "Error: $tool is not installed. Please install it and try again."
8+
exit 1
9+
fi
10+
done
11+
412
INTERVAL=10
513

614
TITLE="MySQL Monitor v2025.01.22 (Press 'q' to exit)"

0 commit comments

Comments
 (0)