Skip to main content

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

OptionDescriptionExample
-h HOSTRouter IP/hostname-h 192.168.1.1
-u USERSSH username-u admin
-p PORTSSH port-p 2222
-k KEYSSH key path-k ~/.ssh/id_rsa
-t TYPERouter 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 identification
  • push_devices.sh - Device monitoring (dual SIM)
  • push_devices_single_sim.sh - Device monitoring (single SIM)
  • push_dhcp.sh - DHCP monitoring
  • push_signal_strength.sh - Signal monitoring
  • push_sim_slot.sh - SIM slot monitoring
  • auto-update.sh - Automatic updates

Configuration

  • supabase_config.env - Database configuration
  • crontab - 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