diff --git a/images/paperless-ng/paperless-ng.sh b/images/paperless-ng/paperless-ng.sh index 2131fc1..ecec1d6 100755 --- a/images/paperless-ng/paperless-ng.sh +++ b/images/paperless-ng/paperless-ng.sh @@ -26,6 +26,20 @@ if [[ ! -d "${output_dir}" ]]; then exit 1; 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")"; on_exit() { log_msg "Cleaning up";