diff --git a/ct/grafana.sh b/ct/grafana.sh index dc1eb14db..8c0568256 100644 --- a/ct/grafana.sh +++ b/ct/grafana.sh @@ -11,7 +11,7 @@ var_cpu="${var_cpu:-1}" var_ram="${var_ram:-512}" var_disk="${var_disk:-2}" var_os="${var_os:-debian}" -var_version="${var_version:-12}" +var_version="${var_version:-13}" var_unprivileged="${var_unprivileged:-1}" header_info "$APP" @@ -20,19 +20,29 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -f /etc/apt/sources.list.d/grafana.list ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi + header_info + check_container_storage + check_container_resources - msg_info "Updating ${APP}" - $STD apt-get update - $STD apt-get -y upgrade - msg_ok "Updated successfully!" - exit + if ! dpkg -s grafana >/dev/null 2>&1; then + msg_error "No ${APP} Installation Found!" + exit 1 + fi + + if [[ -f /etc/apt/sources.list.d/grafana.list ]] || [[ ! -f /etc/apt/sources.list.d/grafana.sources ]]; then + setup_deb822_repo \ + "grafana" \ + "https://apt.grafana.com/gpg.key" \ + "https://apt.grafana.com" \ + "stable" \ + "main" + fi + + msg_info "Updating Grafana LXC" + $STD apt update + $STD apt --only-upgrade install -y grafana + msg_ok "Updated successfully!" + exit } start diff --git a/frontend/public/json/grafana.json b/frontend/public/json/grafana.json index 201e93bee..57438dd7a 100644 --- a/frontend/public/json/grafana.json +++ b/frontend/public/json/grafana.json @@ -23,7 +23,7 @@ "ram": 512, "hdd": 2, "os": "debian", - "version": "12" + "version": "13" } }, { diff --git a/install/grafana-install.sh b/install/grafana-install.sh index 5c1920002..b35c58f78 100644 --- a/install/grafana-install.sh +++ b/install/grafana-install.sh @@ -14,26 +14,23 @@ network_check update_os msg_info "Installing Dependencies" -$STD apt-get install -y \ - apt-transport-https \ - software-properties-common +$STD apt install -y apt-transport-https msg_ok "Installed Dependencies" msg_info "Setting up Grafana Repository" -curl -fsSL "https://apt.grafana.com/gpg.key" -o "/usr/share/keyrings/grafana.key" -echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" >/etc/apt/sources.list.d/grafana.list -msg_ok "Set up Grafana Repository" +setup_deb822_repo \ + "grafana" \ + "https://apt.grafana.com/gpg.key" \ + "https://apt.grafana.com" \ + "stable" \ + "main" +msg_ok "Grafana Repository setup sucessfully" msg_info "Installing Grafana" -$STD apt-get update -$STD apt-get install -y grafana -systemctl enable -q --now grafana-server +$STD apt install -y grafana +systemctl enable -q --now grafana-server msg_ok "Installed Grafana" motd_ssh customize - -msg_info "Cleaning up" -$STD apt-get -y autoremove -$STD apt-get -y autoclean -msg_ok "Cleaned" +cleanup_lxc