Skip to content

Commit 701c99c

Browse files
committed
feat: add command reference documentation and improve user prompts in scripts
1 parent 116a37a commit 701c99c

File tree

3 files changed

+132
-3
lines changed

3 files changed

+132
-3
lines changed

docs/COMMANDS.md

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# Quick Reference - All Available Commands
2+
3+
## 🚀 Main Setup
4+
```bash
5+
bash install.sh setup # Full server setup
6+
bash install.sh s # Short version
7+
bash install.sh a # Short version
8+
```
9+
10+
## 🔐 SSH Configuration
11+
```bash
12+
bash install.sh ssh_port # Change SSH port
13+
bash install.sh sp # Short version
14+
15+
bash install.sh ssh_timeout # Auto logout after 5min idle
16+
bash install.sh st # Short version
17+
```
18+
19+
## 🐘 PHP Installation
20+
```bash
21+
bash install.sh php # Install PHP
22+
bash install.sh php_extension 8.4 # Install PHP 8.4 extensions
23+
bash install.sh pe 8.4 # Short version
24+
```
25+
26+
## 🐳 Docker Tools
27+
```bash
28+
bash install.sh lazydocker # Install lazydocker
29+
bash install.sh ld # Short version
30+
```
31+
32+
## 🌍 Global Development Environment
33+
```bash
34+
# Install NVM, NPM, Yarn, ZSH for all users
35+
bash install.sh global_dev
36+
bash install.sh gd # Short version
37+
38+
# Force update for existing users
39+
bash install.sh global_dev -f
40+
bash install.sh gd --force
41+
```
42+
43+
## 📊 Zabbix Monitoring
44+
45+
### Install Zabbix Server
46+
```bash
47+
bash install.sh zabbix_server
48+
bash install.sh zs # Short version
49+
```
50+
Features:
51+
- Auto-detects Nginx/Apache
52+
- MySQL/MariaDB database
53+
- Zabbix 7.0 LTS
54+
- Secure random passwords
55+
- Firewall configuration
56+
57+
### Install Zabbix Agent (Client)
58+
```bash
59+
# Will prompt for Server IP
60+
bash install.sh zabbix_client
61+
bash install.sh zc # Short version
62+
63+
# Pass Server IP directly
64+
bash install.sh zabbix_client 192.168.1.100
65+
bash install.sh zc 192.168.1.100
66+
```
67+
68+
## 🔧 Troubleshooting
69+
70+
### Fix MySQL FROZEN Issue
71+
When you see "MySQL has been frozen" error:
72+
```bash
73+
bash install.sh fix_mysql
74+
bash install.sh fix_mysql_frozen
75+
bash install.sh fmf # Short version
76+
```
77+
78+
This fixes the issue when downgrading from MariaDB to MySQL.
79+
80+
## 📋 All Commands Summary
81+
82+
| Command | Short | Description |
83+
|---------|-------|-------------|
84+
| `setup` | `s`, `a` | Full server setup |
85+
| `ssh_port` | `sp` | Change SSH port |
86+
| `ssh_timeout` | `st` | Configure SSH timeout |
87+
| `php` | - | Install PHP |
88+
| `php_extension` | `pe` | Install PHP extensions |
89+
| `lazydocker` | `ld` | Install lazydocker |
90+
| `global_dev` | `gd` | Global dev environment |
91+
| `zabbix_server` | `zs` | Install Zabbix Server |
92+
| `zabbix_client` | `zc` | Install Zabbix Agent |
93+
| `fix_mysql` | `fmf` | Fix MySQL FROZEN issue |
94+
95+
## 💡 Examples
96+
97+
```bash
98+
# Setup new server
99+
bash install.sh setup
100+
101+
# Change SSH port to 2222
102+
bash install.sh ssh_port 2222
103+
104+
# Install PHP 8.4 extensions
105+
bash install.sh php_extension 8.4
106+
107+
# Setup Zabbix monitoring
108+
bash install.sh zabbix_server
109+
bash install.sh zabbix_client 192.168.1.100
110+
111+
# Fix MySQL issue
112+
bash install.sh fix_mysql
113+
114+
# Global dev environment with force update
115+
sudo bash install.sh global_dev --force
116+
```
117+
118+
## 🆘 Need Help?
119+
120+
```bash
121+
bash install.sh
122+
# Shows usage information
123+
```
124+
125+
For detailed documentation, see:
126+
- [README.md](../README.md) - Full documentation
127+
- [ZABBIX-SETUP.md](setup/system/ZABBIX-SETUP.md) - Zabbix guide
128+
- [SSH-TIMEOUT-DEBUG.md](setup/system/SSH-TIMEOUT-DEBUG.md) - SSH timeout debug
129+

setup/system/fix-mysql-frozen.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ echo "Choose an option:"
2828
echo " 1) Remove MySQL/MariaDB and clean everything (recommended)"
2929
echo " 2) Just remove FROZEN file (risky, may cause data corruption)"
3030
echo " 3) Cancel"
31-
read -p "Enter choice [1-3]: " choice
31+
read -r -p "Enter choice [1-3]: " choice
3232

3333
case "$choice" in
3434
1)

setup/system/zabbix.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ install_zabbix_server() {
9494
echo " 1) Use existing ${DB_TYPE} (recommended if working)"
9595
echo " 2) Remove ${DB_TYPE} and install fresh MySQL 8.0"
9696
echo " 3) Cancel installation"
97-
read -p "Enter choice [1-3]: " db_choice
97+
read -r -p "Enter choice [1-3]: " db_choice
9898

9999
case "$db_choice" in
100100
1)
@@ -320,7 +320,7 @@ install_zabbix_agent() {
320320
echo ''
321321

322322
# Get Zabbix server address from user
323-
read -p "Enter Zabbix Server IP address: " ZABBIX_SERVER_IP
323+
read -r -p "Enter Zabbix Server IP address: " ZABBIX_SERVER_IP
324324

325325
if [ -z "$ZABBIX_SERVER_IP" ]; then
326326
print_error "Zabbix Server IP is required"

0 commit comments

Comments
 (0)