node-red-dark.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. clear
  10. echo -e "${RD}Backup your Node-Red flows before running this script!!${CL} \n "
  11. while true; do
  12. read -p "This will Install midnight-red theme. Proceed(y/n)?" yn
  13. case $yn in
  14. [Yy]* ) break;;
  15. [Nn]* ) exit;;
  16. * ) echo "Please answer yes or no.";;
  17. esac
  18. done
  19. clear
  20. echo -en "${GN} Updating Container OS... "
  21. apt-get update &>/dev/null
  22. apt-get -qqy upgrade &>/dev/null
  23. echo -e "${CM}${CL} \r"
  24. echo -en "${GN} Installing midnight-red Theme... "
  25. cd /root/.node-red
  26. npm install @node-red-contrib-themes/midnight-red &>/dev/null
  27. echo -e "${CM}${CL} \r"
  28. echo -en "${GN} Writing Settings... "
  29. cat <<EOF > /root/.node-red/settings.js
  30. module.exports = { uiPort: process.env.PORT || 1880,
  31. mqttReconnectTime: 15000,
  32. serialReconnectTime: 15000,
  33. debugMaxLength: 1000,
  34. functionGlobalContext: {
  35. },
  36. exportGlobalContextKeys: false,
  37. // Configure the logging output
  38. logging: {
  39. console: {
  40. level: "info",
  41. metrics: false,
  42. audit: false
  43. }
  44. },
  45. // Customising the editor
  46. editorTheme: {
  47. theme: "midnight-red"
  48. },
  49. projects: {
  50. // To enable the Projects feature, set this value to true
  51. enabled: false
  52. }
  53. }
  54. EOF
  55. echo -e "${CM}${CL} \r"
  56. echo -en "${GN} Restarting Node-Red... "
  57. echo -e "${CM}${CL} \r"
  58. node-red-restart
  59. echo -en "${GN} Finished... ${CL} \n"
  60. exit