From 28e4954da6e2671d33665b1681dd71fdbd9473a1 Mon Sep 17 00:00:00 2001 From: Tsvetomir Hristov Date: Tue, 15 Oct 2024 01:09:09 +0200 Subject: [PATCH] Fixing issues with the code --- ct/kibana.sh | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/ct/kibana.sh b/ct/kibana.sh index b751aac4..e7966069 100644 --- a/ct/kibana.sh +++ b/ct/kibana.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build.func) +source <(curl -s https://raw.githubusercontent.com/ELKozel/Proxmox/main/misc/build.func) # Copyright (c) 2024 ELKozel # Author: T.H. (ELKozel) # License: MIT @@ -8,11 +8,11 @@ source <(curl -s https://raw.githubusercontent.com/tteck/Proxmox/main/misc/build function header_info { clear cat <<"EOF" - _ ___ _ -| |/ (_) |__ __ _ _ __ __ _ -| ' /| | '_ \ / _` | '_ \ / _` | -| . \| | |_) | (_| | | | | (_| | -|_|\_\_|_.__/ \__,_|_| |_|\__,_| + __ __ _ __ + / //_/(_) /_ ____ _____ ____ _ + / ,< / / __ \/ __ `/ __ \/ __ `/ + / /| |/ / /_/ / /_/ / / / / /_/ / +/_/ |_/_/_.___/\__,_/_/ /_/\__,_/ EOF } @@ -53,27 +53,28 @@ function default_settings() { } function update_script() { - header_info - if [[ ! -f /etc/systemd/system/elasticsearch.service ]]; then msg_error "No ${APP} Installation Found!"; exit; fi - if (( $(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80 )); then - read -r -p "Warning: Storage is dangerously low, continue anyway? " prompt - [[ ${prompt,,} =~ ^(y|yes)$ ]] || exit - fi +header_info +if [[ ! -f /etc/systemd/system/Kibana.service ]]; then msg_error "No ${APP} Installation Found!"; exit; fi +if (( $(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80 )); then + read -r -p "Warning: Storage is dangerously low, continue anyway? " prompt + [[ ${prompt,,} =~ ^(y|yes)$ ]] || exit +fi - msg_info "Stopping ${APP}" - $STD /bin/systemctl stop kibana.service - msg_ok "Stopped ${APP}" +msg_info "Stopping ${APP}" +systemctl stop Kibana +msg_ok "Stopped ${APP}" - msg_info "Updating ${APP}" - $STD apt-get install kibana &>/dev/null - msg_ok "Updated ${APP}" +msg_info "Updating ${APP} LXC" +apt-get update &>/dev/null +apt-get -y upgrade &>/dev/null +msg_ok "Updated ${APP} LXC" - msg_info "Starting ${APP}" - $STD /bin/systemctl restart kibana.service - msg_ok "Started ${APP}" +msg_info "Starting ${APP}" +systemctl start Kibana +msg_ok "Started ${APP}" - msg_ok "Updated Successfully" - exit +msg_ok "Updated Successfully" +exit } start @@ -82,4 +83,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${APP} Setup should be reachable by going to the following URL. - ${BL}http://${IP}:5601${CL} \n" \ No newline at end of file + ${BL}http://${IP}:5601${CL} \n"