You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

init.setup 1.3KB

4 months ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/bin/bash
  2. #update sytem
  3. sudo apt-get -y update
  4. sudo apt-get -y upgrade
  5. #enable and start ssh
  6. sudo systemctl enable ssh
  7. sudo systemctl start ssh
  8. #install remote desktop
  9. sudo apt-get -y install xrdp
  10. #install nodejs
  11. sudo apt-get -y install nodejs
  12. #install npm
  13. sudo apt-get -y install npm
  14. #install firefox
  15. sudo apt-get -y install firefox-esr
  16. cd `dirname $0`
  17. echo "`dirname $0`"
  18. #get correct node modules
  19. rm -rf node_modules
  20. npm install express
  21. npm install bcrypt
  22. npm install nedb
  23. npm install express-session
  24. npm install nedb-session-store
  25. #add server.start to autostart if not found
  26. find="`grep server.start /etc/rc.local`"
  27. if [ "$find" = "" ]
  28. then
  29. echo "adding server startup to /etc/rc.local"
  30. cp /etc/rc.local "`pwd`"
  31. sed -i '$d' rc.local
  32. echo "`pwd`/server.start" >> rc.local
  33. echo "exit 0" >> rc.local
  34. sudo mv rc.local /etc/rc.local
  35. else
  36. echo "server startup already in /etc/rc.local"
  37. fi
  38. #add firefox start in kiosk mode after logged in
  39. find="`grep firefox ~/.profile`"
  40. if [ "$find" = "" ]
  41. then
  42. echo "adding firefox start to ~/.profile"
  43. echo "firefox --kiosk http://localhost:8080/info &" >> ~/.profile
  44. else
  45. echo "firefox start already found in ~/.profile"
  46. fi
  47. sudo chmod +x server.start
  48. echo "network/mac adress:`hostname -I`"
  49. #system restart
  50. echo "System will restart in 10s. ^C to cancel"
  51. sleep 10
  52. sudo reboot -h now