20_oboo_configuration 879 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. ## General Oboo Smart Clock configuration
  3. device=$(ubus call system board | jsonfilter -e '@.model')
  4. if [ "$device" == "Oboo Smart Clock" ]; then
  5. # disable ssh access for production device
  6. /etc/init.d/dropbear disable && /etc/init.d/dropbear stop
  7. # configure password for production device
  8. sed -e 's/^root.*$/root:\$1\$FhvtWK1E\$k9VNrFBB02\/7K3d5XyLVS0:17780:0:99999:7:::/' -i /etc/shadow
  9. fi
  10. # require login for serial access
  11. uci -q batch <<-EOF > /dev/null
  12. set system.@system[0].ttylogin='1'
  13. commit system
  14. EOF
  15. # other actions
  16. # enable ntpd to run at boot
  17. /etc/init.d/sysntpd enable
  18. # modifications to rc.local
  19. echo "touch /tmp/setupMode
  20. /etc/init.d/sysntpd restart
  21. if [ ! -e /etc/config.json ]; then
  22. touch /etc/config.json
  23. echo '{"config":{}}' > /etc/config.json
  24. /usr/bin/ort /usr/bin/js/updateConfig.js
  25. fi
  26. exit 0" > /etc/rc.local
  27. exit 0