paperless-ng: check for required commands
This commit is contained in:
parent
ddebb2c02a
commit
83108c82ba
1 changed files with 14 additions and 0 deletions
|
@ -26,6 +26,20 @@ if [[ ! -d "${output_dir}" ]]; then
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# $1 - Command name to check for
|
||||||
|
check_command() {
|
||||||
|
which $1 >/dev/null 2>&1; exit_code=$?
|
||||||
|
if [[ "${exit_code}" -ne 0 ]]; then
|
||||||
|
log_msg "Error: Couldn't locate $1. Make sure it's installed and in your path.";
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_command mktemp;
|
||||||
|
check_command curl;
|
||||||
|
check_command jq;
|
||||||
|
|
||||||
|
|
||||||
temp_dir="$(mktemp --tmpdir -d "docker-images-paperless-ng-XXXXXXX")";
|
temp_dir="$(mktemp --tmpdir -d "docker-images-paperless-ng-XXXXXXX")";
|
||||||
on_exit() {
|
on_exit() {
|
||||||
log_msg "Cleaning up";
|
log_msg "Cleaning up";
|
||||||
|
|
Loading…
Reference in a new issue