2022-11-15 22:49:36 +01:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
|
|
|
API_KEY=test
|
|
|
|
URL=http://localhost:18080
|
|
|
|
|
|
|
|
if [ "$1" = add ]; then
|
|
|
|
curl \
|
|
|
|
-XPOST \
|
2022-11-21 12:03:16 +01:00
|
|
|
-d "$2" \
|
2022-11-15 22:49:36 +01:00
|
|
|
-H "X-Api-Key: $API_KEY" \
|
2022-11-21 12:03:16 +01:00
|
|
|
"$URL/$3"
|
2022-11-16 13:05:09 +01:00
|
|
|
|
|
|
|
elif [ "$1" = get ]; then
|
2022-11-21 15:28:02 +01:00
|
|
|
curl -is "$URL/$2" | sed -En 's/^[lL]ocation: (.*)/\1/p'
|
2022-11-15 22:49:36 +01:00
|
|
|
fi
|