root/software/hbkcd/scripts/hbkcd_add.sh @ 4c67c9e8
| a5afc963 | David Sorber | #!/bin/bash
|
||
ADDRESS="brutus"
|
||||
PORT="8081"
|
||||
if [ "$#" -ne 2 ]; then
|
||||
echo "USAGE: hbkcd_add <path to input file> <path to output file/directory>"
|
||||
exit -1
|
||||
fi
|
||||
# Make sure curl ad jq are installed
|
||||
command -v curl >/dev/null 2>&1 || { echo >&2 "Please install curl to use this script. Aborting."; exit 1; }
|
||||
command -v jq >/dev/null 2>&1 || { echo >&2 "Please install jq to use this script. Aborting."; exit 1; }
|
||||
| a9f959b7 | David Sorber | INPUT_PATH=$(readlink -f "$1")
|
||
#~ echo '{"type": "add", "path": "'"$INPUT_PATH"'", "output": "'"$2"'"}'
|
||||
curl -s -d '{"type": "add", "path": "'"$INPUT_PATH"'", "output": "'"$2"'"}' -X POST http://$ADDRESS:$PORT/command | jq
|