Adds discover-remote-device-ports.sh
This commit is contained in:
9
scripts/shell/discover-remote-device-ports.sh
Executable file
9
scripts/shell/discover-remote-device-ports.sh
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
remote_ip="192.168.0.20"
|
||||||
|
|
||||||
|
mapfile -t ports_list < <(nmap "${remote_ip}" -p 37000-44000 -oG - | grep -oP '\d+(?=\/open\/tcp)')
|
||||||
|
|
||||||
|
for port in "${ports_list[@]}"; do
|
||||||
|
echo "./adb.exe connect ${remote_ip}:${port}"
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user