Compared files  

Left
/fw/dreame.vacuum.p2041o/4.1.2_1107/xout/_root/etc/rc.d/miio.sh
Last modified2021-06-29 12:11:58
Size1.8 Kb (78 Lines)
EncodingLatin 1 - ANSI (CP1252) default
Right
/fw/dreame.vacuum.p2041/4.3.2_1108/xout/_root/etc/rc.d/miio.sh
Last modified2021-11-04 08:52:09
Size2.6 Kb (98 Lines)
EncodingUnicode 8 bits (UTF-8) - without signature autodetected


   Comparison Statistics  

Detailed Statistics

All Changes
 BlocksLines
Unchanged920
Inserted11
Deleted00
Ignored00
Changed7135




   Comparison Details  

1 skipped line
2 2 source /usr/bin/config
3 3 DEBUG_VERSION_FILE=/data/initialize.sh
4 4  
5 MIIO_CLIENT_LOG=/data/log/miio_client.log 5 MIOT_LOG=/data/log/miio_client.log
6 MIIO_AGENT_LOG=/data/log/miio_agent.log 6 MIAT_LOG=/data/log/miio_agent.log
7   7  
8 if [ "$PRODUCT_NAME" == "p2036" ]; then 8 if [ "${BOARD_TYPE}" == "MR112" ]; then
9 9     LOG_MAX_SIZE=1048576
10 10 else
11 11     LOG_MAX_SIZE=5242880
12 12 fi
13 13  
14 function do_stop() 14 function miio_ready_check()
15 { 15 {
  16     if [ ! -f "${DEVICE_CONF_FILE}" ]; then
  17         exit 0
  18     fi
  19  
16     if [ -e /usr/bin/miio_client_helper_mjac.sh ]; then 20     if [ "${MIIO_SDK_MJAC}" == "true" ]; then
  21         MIIO_STR1=`grep "mjac_i2c" ${DEVICE_CONF_FILE} | cut -d '=' -f 2`
17         killall -9 miio_client_helper_mjac.sh 22         MIIO_STR2=`grep "mjac_gpio" ${DEVICE_CONF_FILE} | cut -d '=' -f 2`
18 23     else
19         killall -9 miio_client_helper_nomqtt.sh 24         MIIO_STR1=`grep "did=" ${DEVICE_CONF_FILE} | cut -d '=' -f 2`
  25         MIIO_STR2=`grep "key=" ${DEVICE_CONF_FILE} | cut -d '=' -f 2`
20 26     fi
21 27  
22     killall -9 miio_recv_line miio_agent 28     if [ -z "${MIIO_STR1}" -o -z "${MIIO_STR2}" ]; then
23     killall -9 miio_client 29         exit 0
  30     fi
24 31 }
25 32  
  33 function do_start()
  34 {
  35     # 设置miio_client启动参数配
26 if [ ! -f ${DEVICE_CONF_FILE} ]; then 36     if [ "${MIIO_SDK_MJAC}" == "true" ]; then       # 米家安全芯片,使用 -oMSC,默认开启kv存储功能
27     exit 0 37         MIOT_CONF=" -D -d/etc/miio/ -oMSC"
28 fi  
29    
30 if [ "$1" == "stop" ]; then 38     elif [ "${MIIO_AUTO_OTA}" == "true" ]; then     # 支持自动OTA升级,必须启动kv存储功能
31     do_stop 39         MIOT_CONF=" -D -d/etc/miio/"
32     exit 0  
33 fi  
34    
35 if [ -e /usr/bin/miio_client_helper_mjac.sh ]; then 40     elif [ "${MIIO_KV_STORE}" == "false" ]; then    # 需要关闭kv存储(不支持自动OTA时有效),使用 -oDISABLE_PSM
36     MIIO_SDK_MJAC=1  
37    
38     killall -9 miio_client miio_agent 41         MIOT_CONF=" -D -d/etc/miio-oDISABLE_PSM"
  42     else                                            # 默认开启kv存储功能
39     killall -9 miio_client_helper_mjac.sh 43         MIOT_CONF=" -D -d/etc/miio/"
40 else 44     fi
41     MIIO_SDK_MJAC=0 45  
42   46     # 设置miio_agent启动参数配置
  47     MIAT_CONF=" -D"
  48  
  49     # 设置miio_client日志参数
43     DID=`grep "did=" ${DEVICE_CONF_FILE} | cut -d '=' -f 2` 50     if [ -f "${DEBUG_VERSION_FILE}" ]; then
44     KEY=`grep "key=" ${DEVICE_CONF_FILE} | cut -d '=' -f 2` 51         backup_log_file ${MIAT_LOG} ${LOG_MAX_SIZE} yes
45   52         MIOT_CONF="${MIOT_CONF} -l0 -s1024 -L${MIOT_LOG}"
46     if [[ -z "${DID}" -o -z "${KEY}" ]]; then 53         MIAT_CONF="${MIAT_CONF} -l4 -L${MIAT_LOG}"
47         exit 0 54     else
  55         MIAT_CONF="${MIAT_CONF} -l0"
48 56     fi
49 57  
  58     # kill miio sdk
  59     killall -9 miio_client_helper_nomqtt.sh > /dev/null 2>&1
50     killall -9 miio_client miio_agent 60     killall -9 miio_client miio_agent > /dev/null 2>&1
  61  
  62     log "start miio_client miio_client_helper_nomqtt.sh miio_agent"
  63     miio_client ${MIOT_CONF} > /dev/null 2>&1
  64     miio_client_helper_nomqtt.sh > /dev/null 2>&1 &
  65     miio_agent ${MIAT_CONF} > /dev/null 2>&1
  66 }
  67  
  68 function do_stop()
  69 {
  70     log "stop miio_client_helper_nomqtt.sh miio_client miio_agent miio_recv_line"
51 71     killall -9 miio_client_helper_nomqtt.sh
52 fi 72     killall -9 miio_client miio_agent
53   73     killall -9 miio_recv_line
54 if [  -f "${DEBUG_VERSION_FILE}" ]; then  
55     backup_log_file ${MIIO_CLIENT_LOG} ${LOG_MAX_SIZE} yes  
56     backup_log_file ${MIIO_AGENT_LOG} ${LOG_MAX_SIZE} yes  
57    
58     if [ ${MIIO_SDK_MJAC} == 1 ]; then  
59         miio_client -D -oMSC -d/etc/miio/ -l0 -s1024 -L/data/log/miio_client.log 2>&1 74     rm -f /tmp/miio_unix_* > /dev/null 2>&1
  75 }
  76  
60         miio_client_helper_mjac.sh > /dev/null 2>&1 & 77 miio_ready_check
61     else 78  
62         miio_client -D -L/data/log/miio_client.log > /dev/null 2>&1 79 case "$1" in
63         miio_client_helper_nomqtt.sh > /dev/null 2>&1 & 80     start)
64     fi 81         do_start
65     miio_agent -D -L/data/log/miio_agent.log > /dev/null 2>&1 82         ;;
66 else 83     stop)
67     if [ ${MIIO_SDK_MJAC} == 1 ]; then 84         do_stop
68         miio_client -D -oMSC -d/etc/miio/ -l4 2>&1 85         ;;
69         miio_client_helper_mjac.sh > /dev/null 2>&1 & 86     restart)
70     else 87         do_stop
71         miio_client -D -l0 > /dev/null 2>&1 88         sleep 1
72         miio_client_helper_nomqtt.sh > /dev/null 2>&1 & 89         do_start
73     fi 90         ;;
74     miio_agent -D -l0 > /dev/null 2>&1 91     *)
75 fi 92         do_start
  93         ;;
  94 esac
76 95  
77 96 log "$0 load !!!!"
  97 exit 0
78 98  

   Text comparison Options  

Syntax colouring language used: Shell
Match character case: yes.
Match line endings: no.
Match spaces

At start of lines: yes,
In middle of lines: yes,
At end of lines: yes.
Blank lines as empty lines: no.
Activate comparison algorithm
At word level: yes,
At character level: no.


   Legend  

Unchanged lineExample of unchanged line
Modified lineExample of modified line
Added lineExample of added line
Removed lineExample of removed line
Ignored lineExample of ignored line