root/software/hbkcd/scripts/hbkcd_add.sh @ edd171a6
| 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; }
|
|||
INPUT_PATH=$(readlink -f $1)
|
|||
curl -s -X POST -d '{"type": "add", "path": "'$INPUT_PATH'", "output": "'$2'"}' http://$ADDRESS:$PORT/command | jq
|