various
parent
6a40e22b90
commit
769cf5f2a1
|
@ -1,9 +1,13 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if [[ "$(realpath "$(dirname "$(realpath -s "$0")")/../../../")" == "/" ]]; then
|
if [[ -n $ZIO_HELPERS_DIR ]] && [[ -f $ZIO_HELPERS_DIR ]]; then
|
||||||
. /usr/local/libexec/zio/helpers/bash.sh
|
. "$ZIO_HELPERS_DIR/bash.sh"
|
||||||
else
|
else
|
||||||
|
if [[ "$(realpath "$(dirname "$(realpath -s "$0")")/../../../")" == "/" ]]; then
|
||||||
|
. /usr/local/libexec/zio/helpers/bash.sh
|
||||||
|
else
|
||||||
. "$(dirname "$(realpath -s "$0")")/../libexec/zio/helpers/bash.sh"
|
. "$(dirname "$(realpath -s "$0")")/../libexec/zio/helpers/bash.sh"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
me_filename="$(basename "$(realpath -s "$0")")"
|
me_filename="$(basename "$(realpath -s "$0")")"
|
||||||
|
@ -65,10 +69,12 @@ function invoke_restic() {
|
||||||
elif [[ $command == "self-update" ]]; then
|
elif [[ $command == "self-update" ]]; then
|
||||||
say warning "Command '$command' not supported. Not running"
|
say warning "Command '$command' not supported. Not running"
|
||||||
else
|
else
|
||||||
|
# TODO: Handle deadlocks (--retry-lock could go on forever)
|
||||||
"$restic_path" \
|
"$restic_path" \
|
||||||
--cache-dir "$cache_dir" \
|
--cache-dir "$cache_dir" \
|
||||||
--password-file "$restic_repo_passwd_file" \
|
--password-file "$restic_repo_passwd_file" \
|
||||||
--repo "$(cat $restic_repo_file)" \
|
--repo "$(cat $restic_repo_file)" \
|
||||||
|
--retry-lock 5m \
|
||||||
$command $args
|
$command $args
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue