Bash Script to Automatically Detect and Scan Your Local Network! Hackpens 1 year ago Bash Script to Automatically Detect and Scan Your Local Network! How to write a script in Bash that detects the network you’re connected to, sweep it to find devices, and scan those devices for open ports.