#!/bin/bash # Get the current Wi-Fi network name wifi_name=$(iwgetid -r) # Output the Wi-Fi network name, or "Disconnected" if not connected if [ -z "$wifi_name" ]; then echo '{"status":"Disconnected"}' else echo "{\"status\":\"$wifi_name\"}" fi