2022-09-14 00:44:31 +00:00
|
|
|
#!/bin/bash
|
|
|
|
constate=$(nmcli dev | grep wifi | sed 's/ \{2,\}/|/g' | cut -d '|' -f3 | head -1)
|
|
|
|
currentwfi=$(nmcli dev | grep wifi | sed 's/ \{2,\}/|/g' | cut -d '|' -f4 | head -1)
|
|
|
|
|
|
|
|
if [ "$constate" = "disconnected" ]; then
|
2022-12-20 00:15:21 +00:00
|
|
|
echo " wfi: disc"
|
2022-09-14 00:44:31 +00:00
|
|
|
elif [ "$constate" = "connected" ]; then
|
2022-12-20 00:15:21 +00:00
|
|
|
echo " wfi: $currentwfi"
|
2022-09-14 00:44:31 +00:00
|
|
|
else
|
2022-12-20 00:15:21 +00:00
|
|
|
echo " wfi: disc"
|
2022-09-14 00:44:31 +00:00
|
|
|
fi
|