From 6789b685a6f5f425920ccb62bb8955ac72efadb8 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 11 Jan 2023 19:34:35 -0500 Subject: [PATCH] Update cronicle-v5.sh add directory checks --- ct/cronicle-v5.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ct/cronicle-v5.sh b/ct/cronicle-v5.sh index f03b7f4b..f88bc6c0 100644 --- a/ct/cronicle-v5.sh +++ b/ct/cronicle-v5.sh @@ -316,12 +316,20 @@ UPD=$(whiptail --title "SUPPORT" --radiolist --cancel-button Exit-Script "Spaceb clear header_info if [ "$UPD" == "1" ]; then + if [[ ! -d /opt/cronicle ]]; then + msg_error "No ${APP} Installation Found!"; + exit + fi msg_info "Updating ${APP}" /opt/cronicle/bin/control.sh upgrade &>/dev/null msg_ok "Updated ${APP}" exit fi if [ "$UPD" == "2" ]; then + if [[ -d /opt/cronicle ]]; then + msg_error "${APP} Installation Found!"; + exit + fi LATEST=$(curl -sL https://api.github.com/repos/jhuckaby/Cronicle/releases/latest | grep '"tag_name":' | cut -d'"' -f4) IP=$(hostname -I | awk '{print $1}') msg_info "Installing Dependencies"