-
Notifications
You must be signed in to change notification settings - Fork 0
Home
This guide explains how to use the Drone Data Management Application script to execute commands across multiple drones in a network. The script supports primary and secondary drone groups with different users.
Note: The script is designed for drone fleet management with SSH access. Ensure your system meets the prerequisites before running the script.
Make sure that:
- You have Bash installed (default on most Unix-like systems)
- SSH access is configured for target drones
- The script file (
main.bash) has execute permissions (chmod +x main.bash)
-
Prepare the script
Ensure the script is executable:chmod +x main.bash
-
Run the script with arguments
Supported arguments:-
-primary,-ip: List of IP addresses for primary group -
-puser,-user: Username for primary group -
-secondary: List of IP addresses for secondary group -
-suser: Username for secondary group -
-cmd: Command to execute on all drones (use\$DRONE_NUMfor drone number)
Example:
./main.bash -primary 1 2 3 -user pilot -cmd "echo Drone \$DRONE_NUM ready" -
-
Using Primary and Secondary Groups
You can execute commands on two different groups with different users:./main.bash -primary 1 2 -user pilot1 -secondary 3 4 -suser pilot2 -cmd "status" -
Allowed IP Ranges
The script currently allows these IP suffixes:- Numbers 1-10
- Number 15
- Number 17
- Numbers 20-25
To modify allowed ranges, update the
allowed_ipsarray in the script:allowed_ips=({1..10} 15 17 {20..25})
The script provides detailed error messages for:
- Invalid IP addresses
- IPs outside allowed ranges
- Duplicate IP addresses
- Missing required arguments
- Invalid command format
Tip: The script performs thorough validation before executing any SSH commands to prevent errors during execution.