Check ota.sh and rc.local config

From ESS-WIKI
Revision as of 03:45, 15 September 2021 by William6.chen (talk | contribs) (Created page with "== check_ota.sh == <syntaxhighlight lang="bash"> vim /usr/bin/check_ota.sh #------------------------------------------------------------------------------------ #!/bin/sh...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

check_ota.sh

vim /usr/bin/check_ota.sh
#------------------------------------------------------------------------------------

#!/bin/sh

echo "this is log" > /root/check_ota_log.txt
count=0
while true
do
  echo ${count} > /root/check_ota_log.txt
  count=$((count+1))
  flag=$(cat /mnt/emmc/ota_flag)
  echo "flag is ${flag}" >> /root/check_ota_log.txt
  if [ $flag -eq 1 ]
  then
    echo "system restart ota" >> /root/check_ota_log.txt
  else
    echo "no need to restart for ota" >> /root/check_ota_log.txt
  fi
  sleep 1
done

#----------------------------------------------------------------------------------


chmod 777 /usr/bin/check_ota.sh

rc.local

vim /etc/rc.local
#!/bin/sh -e
check_ota.sh &
echo "this is rc.local 1"
echo "this is rc.local 2" > /root/tt.log