diff --git a/scripts/_lib.sh b/scripts/_lib.sh index ba57fc42a3..a381b6e585 100755 --- a/scripts/_lib.sh +++ b/scripts/_lib.sh @@ -78,7 +78,6 @@ function restore() { } # Needed variables to source error-handling script -MINIMIZE_DOWNTIME="${MINIMIZE_DOWNTIME:-}" export STOP_TIMEOUT=60 # Save logs in order to send envelope to Sentry @@ -86,16 +85,8 @@ log_file="sentry_${cmd%% *}_log-$(date +%Y-%m-%d_%H-%M-%S).txt" exec &> >(tee -a "$log_file") version="" -while (($#)); do - case "$1" in - --report-self-hosted-issues) export REPORT_SELF_HOSTED_ISSUES=1 ;; - --no-report-self-hosted-issues) export REPORT_SELF_HOSTED_ISSUES=0 ;; - *) version=$1 ;; - esac - shift -done - # Source files needed to set up error-handling +source install/_lib.sh source install/dc-detect-version.sh source install/detect-platform.sh source install/error-handling.sh diff --git a/scripts/backup.sh b/scripts/backup.sh index c056b7078b..c92ee4b9ac 100755 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -1,4 +1,17 @@ #!/usr/bin/env bash +MINIMIZE_DOWNTIME="${MINIMIZE_DOWNTIME:-}" +REPORT_SELF_HOSTED_ISSUES="${REPORT_SELF_HOSTED_ISSUES:-}" + +while (($#)); do + case "$1" in + --report-self-hosted-issues) REPORT_SELF_HOSTED_ISSUES=1 ;; + --no-report-self-hosted-issues) REPORT_SELF_HOSTED_ISSUES=0 ;; + --minimize-downtime) MINIMIZE_DOWNTIME=1 ;; + *) version=$1 ;; + esac + shift +done + cmd="backup $1" source scripts/_lib.sh $cmd diff --git a/scripts/reset.sh b/scripts/reset.sh index f519435420..75c244efed 100755 --- a/scripts/reset.sh +++ b/scripts/reset.sh @@ -1,4 +1,17 @@ #!/usr/bin/env bash +MINIMIZE_DOWNTIME="${MINIMIZE_DOWNTIME:-}" +REPORT_SELF_HOSTED_ISSUES="${REPORT_SELF_HOSTED_ISSUES:-}" + +while (($#)); do + case "$1" in + --report-self-hosted-issues) REPORT_SELF_HOSTED_ISSUES=1 ;; + --no-report-self-hosted-issues) REPORT_SELF_HOSTED_ISSUES=0 ;; + --minimize-downtime) MINIMIZE_DOWNTIME=1 ;; + *) version=$1 ;; + esac + shift +done + cmd=reset source scripts/_lib.sh $cmd diff --git a/scripts/restore.sh b/scripts/restore.sh index ae3666b0ec..57cab1bb60 100755 --- a/scripts/restore.sh +++ b/scripts/restore.sh @@ -1,4 +1,17 @@ #!/usr/bin/env bash +MINIMIZE_DOWNTIME="${MINIMIZE_DOWNTIME:-}" +REPORT_SELF_HOSTED_ISSUES="${REPORT_SELF_HOSTED_ISSUES:-}" + +while (($#)); do + case "$1" in + --report-self-hosted-issues) REPORT_SELF_HOSTED_ISSUES=1 ;; + --no-report-self-hosted-issues) REPORT_SELF_HOSTED_ISSUES=0 ;; + --minimize-downtime) MINIMIZE_DOWNTIME=1 ;; + *) version=$1 ;; + esac + shift +done + cmd="restore $1" source scripts/_lib.sh