em:runtime
master
This optimized version makes use of the get_network command in wpa_cli to directly retrieve the network ID of the selected network. This eliminates the need for additional stream processing by avoiding grep and awk.