|
2 | | 2 | | source /usr/bin/config |
|
|
4 | | start() { | | 4 | | function start_ap() { |
|
6 | | 6 | | while [ ${cnt} -le 5 ] |
|
|
10 skipped lines |
|
|
|
| | 21 | | if [ -f ${DEBUG_VERSION_FILE} ]; then |
21 | | /usr/bin/do_start_ap.sh & | | 22 | | /usr/bin/do_start_ap.sh "short_time" & |
| | 23 | | else |
| | 24 | | /usr/bin/do_start_ap.sh & |
| | 25 | | fi |
|
|
24 | | set_wifi_light.sh flash_slow | | 28 | | function start_sta() { |
25 | | | | |
26 | | # 如果是某些特定环境下静默重启,不开启热点(比如:半夜静默重启) | | |
27 | | if [ -f "${AUTO_REBOOT_MARK}" ]; then | | |
28 | | rm -f ${AUTO_REBOOT_MARK} | | 29 | | [ -f ${FACTORY_AP_FILE} ] && rm -f ${FACTORY_AP_FILE} |
29 | | exit 0 | | 30 | | /etc/init.d/wpa_supplicant.sh |
30 | | fi | | 31 | | } |
| | 32 | | |
| | 33 | | set_wifi_light.sh flash_slow |
|
32 | | 35 | | /usr/bin/iot_sdk.sh check_netcfg |
|
|
34 | | if [ ! -f ${FACTORY_AP_FILE} ]; then # 配过网,不需要自动启动热点 | | 37 | | if [ -f ${FACTORY_AP_FILE} ]; then # 未配过网,检查是否需要进入热点模式 |
35 | | exit 0 | | |
36 | | else # 未配过网 | | |
37 | | 38 | | # 如果存在OTA标志,删除该标志,防止配网以后上报OTA状态 |
|
38 | | 39 | | if [ -f ${OTA_MARK} ]; then |
|
|
|
|
| | 43 | | # 如果是某些特定环境下静默重启,不开启热点(比如:半夜静默重启) |
| | 44 | | if [ -f ${AUTO_REBOOT_MARK} ]; then |
| | 45 | | start_sta |
42 | | 46 | | # 如果存在开发环境标志,不需要自动启动热点 |
|
43 | | if [ -f ${WIFI_CONF_FLAG} ]; then | | 47 | | elif [ -f ${WIFI_CONF_FLAG} ]; then |
44 | | rm -f ${FACTORY_AP_FILE} | | 48 | | start_sta |
45 | | exit 0 | | 49 | | # 开启热点 |
| | 50 | | else |
| | 51 | | start_ap |
|
| | 53 | | else # 配过网,不启动热点,进入sta模式 |
| | 54 | | start_sta |
|
|
49 | | start | | 57 | | [ -f ${AUTO_REBOOT_MARK} ] && rm -f ${AUTO_REBOOT_MARK} |
| | 58 | | |
|