Mac Deploy Quick Reference
Quick Start
# Basic deployment
./mac-deploy.sh -h 192.168.1.1
# With SSH key
./mac-deploy.sh -h 192.168.1.1 -u admin -k ~/.ssh/id_rsa
# Force single SIM router
./mac-deploy.sh -h 192.168.1.1 -t single
Command Options
| Option | Description | Example |
|---|---|---|
-h HOST | Router IP/hostname | -h 192.168.1.1 |
-u USER | SSH username | -u admin |
-p PORT | SSH port | -p 2222 |
-k KEY | SSH key path | -k ~/.ssh/id_rsa |
-t TYPE | Router type | -t single or -t dual |
Environment Variables
export ROUTER_HOST="192.168.1.1"
export ROUTER_USER="admin"
export ROUTER_TYPE="single"
export SSH_KEY="~/.ssh/id_rsa"
./mac-deploy.sh
What Gets Deployed
Scripts (/root/scripts/)
detect_router_identity.sh- Router identificationpush_devices.sh- Device monitoring (dual SIM)push_devices_single_sim.sh- Device monitoring (single SIM)push_dhcp.sh- DHCP monitoringpush_signal_strength.sh- Signal monitoringpush_sim_slot.sh- SIM slot monitoringauto-update.sh- Automatic updates
Configuration
supabase_config.env- Database configurationcrontab- Scheduled tasks
Monitoring Schedule
- Devices: Every 5 minutes
- DHCP: Every 15 minutes
- Signal: Every 15 minutes
- SIM Slot: Every 15 minutes
- Auto-Update: Every 2 hours
Troubleshooting
# Test SSH connection
ssh admin@192.168.1.1
# Check if port 8000 is free
lsof -i :8000
# Force router type
./mac-deploy.sh -h 192.168.1.1 -t single
# Check router logs
ssh admin@192.168.1.1 "logread | grep scripts"
Output Colors
- 🔵 [INFO] - General information
- 🟢 [SUCCESS] - Successful operations
- 🟡 [WARNING] - Non-critical issues
- 🔴 [ERROR] - Critical failures