cronicle-install.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. $STD apt-get install -y make
  19. $STD apt-get install -y g++
  20. $STD apt-get install -y gcc
  21. msg_ok "Installed Dependencies"
  22. msg_info "Installing Node.js"
  23. $STD bash <(curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh)
  24. . ~/.bashrc
  25. $STD nvm install 16.20.1
  26. ln -sf /root/.nvm/versions/node/v16.20.1/bin/node /usr/bin/node
  27. msg_ok "Installed Node.js"
  28. msg_info "Installing Cronicle Primary Server"
  29. LATEST=$(curl -sL https://api.github.com/repos/jhuckaby/Cronicle/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
  30. IP=$(hostname -I | awk '{print $1}')
  31. mkdir -p /opt/cronicle
  32. cd /opt/cronicle
  33. $STD tar zxvf <(curl -fsSL https://github.com/jhuckaby/Cronicle/archive/${LATEST}.tar.gz) --strip-components 1
  34. $STD npm install
  35. $STD node bin/build.js dist
  36. sed -i "s/localhost:3012/${IP}:3012/g" /opt/cronicle/conf/config.json
  37. $STD /opt/cronicle/bin/control.sh setup
  38. $STD /opt/cronicle/bin/control.sh start
  39. $STD cp /opt/cronicle/bin/cronicled.init /etc/init.d/cronicled
  40. chmod 775 /etc/init.d/cronicled
  41. $STD update-rc.d cronicled defaults
  42. msg_ok "Installed Cronicle Primary Server"
  43. motd_ssh
  44. customize
  45. msg_info "Cleaning up"
  46. $STD apt-get autoremove
  47. $STD apt-get autoclean
  48. msg_ok "Cleaned"