diff --git a/ct/elasticsearch.sh b/ct/elasticsearch.sh index 2586fd6e..0647b1c5 100644 --- a/ct/elasticsearch.sh +++ b/ct/elasticsearch.sh @@ -1,8 +1,7 @@ #!/usr/bin/env bash source <(curl -s https://raw.githubusercontent.com/ELKozel/Proxmox/main/misc/build.func) -# Copyright (c) 2021-2024 tteck -# Author: tteck (tteckster) -# Co-Author: T.H. (ELKozel) +# Copyright (c) 2024 ELKozel +# Author: T.H. (ELKozel) # License: MIT # https://github.com/tteck/Proxmox/raw/main/LICENSE @@ -54,27 +53,27 @@ 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? <y/N> " prompt - [[ ${prompt,,} =~ ^(y|yes)$ ]] || exit -fi + 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? <y/N> " prompt + [[ ${prompt,,} =~ ^(y|yes)$ ]] || exit + fi -msg_info "Stopping ${APP}" -$STD /bin/systemctl stop elasticsearch.service -msg_ok "Stopped ${APP}" + msg_info "Stopping ${APP}" + $STD /bin/systemctl stop elasticsearch.service + msg_ok "Stopped ${APP}" -msg_info "Updating ${APP}" -$STD apt-get install elasticsearch &>/dev/null -msg_ok "Updated ${APP}" + msg_info "Updating ${APP}" + $STD apt-get install elasticsearch &>/dev/null + msg_ok "Updated ${APP}" -msg_info "Starting ${APP}" -$STD /bin/systemctl restart elasticsearch.service -msg_ok "Started ${APP}" + msg_info "Starting ${APP}" + $STD /bin/systemctl restart elasticsearch.service + msg_ok "Started ${APP}" -msg_ok "Updated Successfully" -exit + msg_ok "Updated Successfully" + exit } start @@ -83,4 +82,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${APP} should be reachable on port 9200 - ${BL}http://${IP}:5678${CL} \n" + ${BL}http://${IP}:9200${CL} \n"