From 24ca126f5a85a49f08ad698038ff4315a74ac7fd Mon Sep 17 00:00:00 2001 From: CalDescent Date: Fri, 29 Oct 2021 17:58:47 +0100 Subject: [PATCH] Various qdata improvements --- tools/qdata | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/qdata b/tools/qdata index 2060bcad..106aea89 100755 --- a/tools/qdata +++ b/tools/qdata @@ -8,10 +8,10 @@ if [ -z "$*" ]; then echo "Usage:" echo echo "Host/update data:" - echo "qdata [PUT/PATCH] [service] [name] [directory] [privkey]" + echo "qdata [PUT/PATCH] [service] [name] [dirpath]" echo echo "Fetch data:" - echo "qdata GET [service] [name] [filename] " + echo "qdata GET [service] [name] [filepath] " echo exit fi @@ -63,11 +63,11 @@ if [[ "${method}" == "PUT" || "${method}" == "PATCH" ]]; then fi elif [[ "${method}" == "GET" ]]; then - filename=$4 + filepath=$4 rebuild=$5 - if [ -z "${filename}" ]; then - filename="index.html" + if [ -z "${filepath}" ]; then + echo "Error: missing filepath. Please supply the relative path to a file within the data structure."; exit fi if [ -z "${rebuild}" ]; then @@ -80,10 +80,10 @@ elif [[ "${method}" == "GET" ]]; then fi # Parse the successful response - output_path="${response}/${filename}" + output_path="${response}/${filepath}" if [ ! -f "${output_path}" ] && [ ! -d "${output_path}" ]; then echo "Error: file not found at path: ${output_path}" - echo "Please ensure you have supplied a valid filename. The default is: index.html" + echo "Please ensure you have supplied a valid filepath." exit fi