diff --git a/usr/local/bin/sh.zio.backup b/usr/local/bin/sh.zio.backup index dfa62c7..3d294ea 100755 --- a/usr/local/bin/sh.zio.backup +++ b/usr/local/bin/sh.zio.backup @@ -1,9 +1,13 @@ #!/usr/bin/env bash -if [[ "$(realpath "$(dirname "$(realpath -s "$0")")/../../../")" == "/" ]]; then - . /usr/local/libexec/zio/helpers/bash.sh +if [[ -n $ZIO_HELPERS_DIR ]] && [[ -f $ZIO_HELPERS_DIR ]]; then + . "$ZIO_HELPERS_DIR/bash.sh" else - . "$(dirname "$(realpath -s "$0")")/../libexec/zio/helpers/bash.sh" + if [[ "$(realpath "$(dirname "$(realpath -s "$0")")/../../../")" == "/" ]]; then + . /usr/local/libexec/zio/helpers/bash.sh + else + . "$(dirname "$(realpath -s "$0")")/../libexec/zio/helpers/bash.sh" + fi fi me_filename="$(basename "$(realpath -s "$0")")" @@ -65,10 +69,12 @@ function invoke_restic() { elif [[ $command == "self-update" ]]; then say warning "Command '$command' not supported. Not running" else + # TODO: Handle deadlocks (--retry-lock could go on forever) "$restic_path" \ --cache-dir "$cache_dir" \ --password-file "$restic_repo_passwd_file" \ --repo "$(cat $restic_repo_file)" \ + --retry-lock 5m \ $command $args fi }