grafana.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. EOF
  16. }
  17. header_info
  18. echo -e "Loading..."
  19. APP="Grafana"
  20. var_disk="2"
  21. var_cpu="1"
  22. var_ram="512"
  23. var_os="debian"
  24. var_version="12"
  25. variables
  26. color
  27. catch_errors
  28. function default_settings() {
  29. CT_TYPE="1"
  30. PW=""
  31. CT_ID=$NEXTID
  32. HN=$NSAPP
  33. DISK_SIZE="$var_disk"
  34. CORE_COUNT="$var_cpu"
  35. RAM_SIZE="$var_ram"
  36. BRG="vmbr0"
  37. NET="dhcp"
  38. GATE=""
  39. DISABLEIP6="no"
  40. MTU=""
  41. SD=""
  42. NS=""
  43. MAC=""
  44. VLAN=""
  45. SSH="no"
  46. VERB="no"
  47. echo_default
  48. }
  49. function update_script() {
  50. header_info
  51. if [[ ! -f /etc/apt/sources.list.d/grafana.list ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
  52. msg_info "Updating ${APP}"
  53. apt-key del 4E40DDF6D76E284A4A6780E48C8C34C524098CB6
  54. wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key
  55. echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" | tee /etc/apt/sources.list.d/grafana.list
  56. apt-get update &>/dev/null
  57. apt-get -y upgrade &>/dev/null
  58. msg_ok "Updated Successfully"
  59. exit
  60. }
  61. start
  62. build_container
  63. description
  64. msg_ok "Completed Successfully!\n"
  65. echo -e "${APP} should be reachable by going to the following URL.
  66. ${BL}http://${IP}:3000${CL} \n"