[Feature][YUKUAI_patch]add 18.02 code

Only Configure: No
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No

Change-Id: I7f71153004f10fc0ea5adfa083866aaeeb1053ac
diff --git a/rootfs/etc/lynq_monitor.sh b/rootfs/etc/lynq_monitor.sh
new file mode 100644
index 0000000..72e61c7
--- /dev/null
+++ b/rootfs/etc/lynq_monitor.sh
@@ -0,0 +1,60 @@
+#!/bin/sh
+while true
+do
+    sleep 30
+    ps -ef|grep lynq-sdk-ready |grep -v "grep" > /dev/null
+    if [ $? -ne 0 ]; then
+        echo "lynq-sdk-ready no exist" > /dev/kmsg
+        sh /etc/init.d/lynq-sdk-ready.sh start
+    else
+        ps -A -ostat,pid,comm |grep lynq-sdk-ready| grep Z > /dev/null
+        if [ $? -eq 0 ]; then
+            echo "lynq-sdk-ready state is Z" > /dev/kmsg
+            pid=$(ps -A -ostat,pid,comm |grep lynq-sdk-ready|grep Z|awk '{print $2}')
+            kill -9 $pid
+            sh /etc/init.d/lynq-sdk-ready.sh start
+        fi
+    fi
+
+    ps -ef|grep lynq-atcid |grep -v "grep" > /dev/null
+    if [ $? -ne 0 ]; then
+        echo "lynq-atcid no exist" > /dev/kmsg
+        sh /etc/init.d/lynq-atcid.sh start
+    else
+        ps -A -ostat,pid,comm |grep lynq-atcid| grep Z > /dev/null
+        if [ $? -eq 0 ]; then
+            echo "lynq-atcid state is Z" > /dev/kmsg
+            pid=$(ps -A -ostat,pid,comm |grep lynq-atcid|grep Z|awk '{print $2}')
+            kill -9 $pid
+            sh /etc/init.d/lynq-atcid.sh start
+        fi
+    fi
+
+    ps -ef|grep lynq-ril-service |grep -v "grep" > /dev/null
+    if [ $? -ne 0 ]; then
+        echo "lynq-ril-service no exist" > /dev/kmsg
+        sh /etc/init.d/lynq-ril-service.sh start
+    else
+        ps -A -ostat,pid,comm |grep lynq-ril-service| grep Z > /dev/null
+        if [ $? -eq 0 ]; then
+            echo "lynq-ril-service state is Z" > /dev/kmsg
+            pid=$(ps -A -ostat,pid,comm |grep lynq-ril-service|grep Z|awk '{print $2}')
+            kill -9 $pid
+            sh /etc/init.d/lynq-ril-service.sh start
+        fi
+    fi
+
+    ps -ef|grep autosuspend |grep -v "grep" > /dev/null
+    if [ $? -ne 0 ]; then
+        echo "lynq-autosuspend no exist" > /dev/kmsg
+        sh /etc/init.d/lynq-autosuspend.sh start
+    else
+        ps -A -ostat,pid,comm |grep autosuspend| grep Z > /dev/null
+        if [ $? -eq 0 ]; then
+            echo "lynq-autosuspend state is Z" > /dev/kmsg
+            pid=$(ps -A -ostat,pid,comm |grep autosuspend|grep Z|awk '{print $2}')
+            kill -9 $pid
+            sh /etc/init.d/lynq-autosuspend.sh start
+        fi   
+    fi
+done