脚本1:
用于测试重启后识别hostapd两个进程,如果当前正常识别到两个进程,则重启设备,重复进行识别进程,知道进程识别有误之后,会退出,往text.txt内写入识别异常的时间
#!/bin/sh sleep 30 count=`ps | grep hostapd | grep -v grep | wc -l` #echo "sssss $count" if [ $count -eq 2 ];then echo "Now rebooting .................." reboot # echo "$date The wlan abnormal!!" > /text.txt fi echo "$date The wlan abnormal!!" > /text.txt