10 lines
254 B
Bash
Executable File
10 lines
254 B
Bash
Executable File
#!/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 |