From 0423caa6434604b91922a79935260fdf24004c4d Mon Sep 17 00:00:00 2001 From: redhat Date: Fri, 31 Mar 2023 17:29:16 +0300 Subject: [PATCH] Cleanup --- Dockerfile | 2 +- backup.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 06819fd..cb44904 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,4 +30,4 @@ RUN chmod 600 /root/.pgpass #Copying script file USER root #switching the user to give elevated access to the commands being executed from the k8s cron job -CMD sh /home/root/backup.sh +CMD bash /home/root/backup.sh diff --git a/backup.sh b/backup.sh index 52650e8..c026c75 100644 --- a/backup.sh +++ b/backup.sh @@ -102,7 +102,7 @@ if [ -n "$HEARTBEAT_URL" ]; then # shellcheck disable=SC2034 MAX_RETRIES=5 CURRENT=0 - while [[ -z "$HTTP_CODE" || $CURRENT -lt $MAX_RETRIES ]]; do + while [[ -z "$HTTP_CODE" || "$CURRENT" -lt "$MAX_RETRIES" ]]; do HTTP_CODE=$(curl --silent --write-out "%{http_code}" --output /dev/null "$HEARTBEAT_URL") if [ "$HTTP_CODE" -eq "$SUCCESS_HTTP_CODE" ]; then exit 0; fi sleep $((2 ** "$CURRENT"))