dashy-install.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/usr/bin/env bash
  2. # Copyright (c) 2021-2023 tteck
  3. # Author: tteck (tteckster)
  4. # License: MIT
  5. # https://github.com/tteck/Proxmox/raw/main/LICENSE
  6. source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
  7. color
  8. verb_ip6
  9. catch_errors
  10. setting_up_container
  11. network_check
  12. update_os
  13. msg_info "Installing Dependencies"
  14. $STD apt-get install -y curl
  15. $STD apt-get install -y sudo
  16. $STD apt-get install -y mc
  17. $STD apt-get install -y git
  18. msg_ok "Installed Dependencies"
  19. msg_info "Installing Node.js (Patience)"
  20. $STD apt-get install -y npm
  21. $STD npm cache clean -f
  22. $STD npm install -g n
  23. $STD n 16.20.1
  24. $STD npm install -g pnpm
  25. ln -sf /usr/local/bin/node /usr/bin/node
  26. msg_ok "Installed Node.js"
  27. msg_info "Installing Yarn"
  28. $STD npm install --global yarn
  29. ln -sf /usr/local/bin/yarn /usr/bin/yarn
  30. msg_ok "Installed Yarn"
  31. msg_info "Installing Dashy (Patience)"
  32. $STD git clone https://github.com/Lissy93/dashy.git
  33. cd /dashy
  34. $STD yarn
  35. export NODE_OPTIONS=--max-old-space-size=1000
  36. $STD yarn build
  37. msg_ok "Installed Dashy"
  38. msg_info "Creating Service"
  39. cat <<EOF >/etc/systemd/system/dashy.service
  40. [Unit]
  41. Description=dashy
  42. [Service]
  43. Type=simple
  44. WorkingDirectory=/dashy
  45. ExecStart=/usr/bin/yarn start
  46. [Install]
  47. WantedBy=multi-user.target
  48. EOF
  49. systemctl -q --now enable dashy
  50. msg_ok "Created Service"
  51. motd_ssh
  52. customize
  53. msg_info "Cleaning up"
  54. $STD apt-get autoremove
  55. $STD apt-get autoclean
  56. msg_ok "Cleaned"