node-red-dark.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/usr/bin/env bash
  2. # bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/misc/node-red-dark.sh)"
  3. set -o errexit
  4. RD=`echo "\033[01;31m"`
  5. BL=`echo "\033[36m"`
  6. CM='\xE2\x9C\x94\033'
  7. GN=`echo "\033[1;92m"`
  8. CL=`echo "\033[m"`
  9. echo -e "${RD}Backup your Node-Red flows before running this script!!${CL} \n "
  10. while true; do
  11. read -p "This will Install midnight-red theme. Proceed(y/n)?" yn
  12. case $yn in
  13. [Yy]* ) break;;
  14. [Nn]* ) exit;;
  15. * ) echo "Please answer yes or no.";;
  16. esac
  17. done
  18. clear
  19. echo -en "${GN} Updating Container OS... "
  20. apt-get update &>/dev/null
  21. apt-get -qqy upgrade &>/dev/null
  22. echo -e "${CM}${CL} \r"
  23. echo -en "${GN} Installing midnight-red Theme... "
  24. cd /root/.node-red
  25. npm install @node-red-contrib-themes/midnight-red &>/dev/null
  26. echo -e "${CM}${CL} \r"
  27. echo -en "${GN} Writing Settings... "
  28. cat <<EOF >> /root/.node-red/settings.js
  29. // Customising the editor
  30. editorTheme: {
  31. theme: "midnight-red"
  32. },
  33. projects: {
  34. // To enable the Projects feature, set this value to true
  35. enabled: true
  36. }
  37. }
  38. EOF
  39. echo -e "${CM}${CL} \r"
  40. echo -en "${GN} Restarting Node-Red... "
  41. echo -e "${CM}${CL} \r"
  42. node-red-restart
  43. echo -en "${GN} Finished... ${CL} \n"
  44. exit