dashy.sh 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #!/usr/bin/env bash
  2. source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func)
  3. # Copyright (c) 2021-2023 tteck
  4. # Author: tteck (tteckster)
  5. # License: MIT
  6. # https://github.com/tteck/Proxmox/raw/main/LICENSE
  7. function header_info {
  8. clear
  9. cat <<"EOF"
  10. ____ __
  11. / __ \____ ______/ /_ __ __
  12. / / / / __ / ___/ __ \/ / / /
  13. / /_/ / /_/ (__ ) / / / /_/ /
  14. /_____/\__,_/____/_/ /_/\__, /
  15. /____/
  16. EOF
  17. }
  18. header_info
  19. echo -e "Loading..."
  20. APP="Dashy"
  21. var_disk="6"
  22. var_cpu="2"
  23. var_ram="2048"
  24. var_os="debian"
  25. var_version="12"
  26. variables
  27. color
  28. catch_errors
  29. function default_settings() {
  30. CT_TYPE="1"
  31. PW=""
  32. CT_ID=$NEXTID
  33. HN=$NSAPP
  34. DISK_SIZE="$var_disk"
  35. CORE_COUNT="$var_cpu"
  36. RAM_SIZE="$var_ram"
  37. BRG="vmbr0"
  38. NET="dhcp"
  39. GATE=""
  40. DISABLEIP6="no"
  41. MTU=""
  42. SD=""
  43. NS=""
  44. MAC=""
  45. VLAN=""
  46. SSH="no"
  47. VERB="no"
  48. echo_default
  49. }
  50. function update_script() {
  51. header_info
  52. if [[ ! -d /dashy/public/ ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
  53. msg_info "Stopping ${APP}"
  54. systemctl stop dashy
  55. msg_ok "Stopped ${APP}"
  56. msg_info "Backing up conf.yml"
  57. cd ~
  58. cp -R /dashy/public/conf.yml conf.yml
  59. msg_ok "Backed up conf.yml"
  60. msg_info "Updating Dashy"
  61. cd /dashy
  62. git merge &>/dev/null
  63. git pull origin master &>/dev/null
  64. yarn &>/dev/null
  65. yarn build &>/dev/null
  66. msg_ok "Updated Dashy"
  67. msg_info "Restoring conf.yml"
  68. cd ~
  69. cp -R conf.yml /dashy/public
  70. msg_ok "Restored conf.yml"
  71. msg_info "Cleaning"
  72. rm -rf conf.yml
  73. msg_ok "Cleaned"
  74. msg_info "Starting Dashy"
  75. systemctl start dashy
  76. msg_ok "Started Dashy"
  77. msg_ok "Updated Successfully"
  78. exit
  79. }
  80. start
  81. build_container
  82. description
  83. msg_ok "Completed Successfully!\n"
  84. echo -e "${APP} should be reachable by going to the following URL.
  85. ${BL}http://${IP}:4000${CL} \n"