pedalboard-scripts/set-pedalboard.sh

17 lines
475 B
Bash
Raw Normal View History

2022-03-25 16:18:43 +01:00
#!/usr/bin/env bash
# author: Daniel Sommer <daniel.sommer@velvettear.de>
# license: MIT
set -e
dir="$(dirname $(realpath "$0"))"
. "$dir/config.env"
[[ -z "$1" ]] && printf "${FONT_BOLD}error: ${FONT_NORMAL}no pedalboard id given\n" && exit 1
url="$(""$dir"/url.sh" "/pedalboards" "$1")"
printf "> sending POST request to \'$url\'...${FONT_BOLD}"
[ "$(curl -X POST -s -f -w "\n%{http_code}" "$url" | tail -n1)" -ne 200 ] && printf " error!\n" || printf " done!\n"