简单的监测wifi连接状态的shell脚本
本帖最后由 wushaominkk 于 2021-5-10 11:03 编辑#!/bin/sh
wpa_state="wpa_state=COMPLETED"
while true ; do
result=`wpa_cli -i wlan0 status | grep -r $wpa_state`
if [ "$wpa_state"x = "$result"x ]
then
echo "wifi is connected"
else
echo "wifi is disconnected"
fi
sleep 1
done
exit 0 学习了,感谢楼主分享 aren123122 发表于 2021-5-10 10:45
学习了,感谢楼主分享
最近搞项目,要现WIFI状态监测,然后随手就写了一下{:1_918:}
页:
[1]