From 3bb27c36163b5c7bbfdd9874e838d220650bd6ba Mon Sep 17 00:00:00 2001 From: velvettear Date: Fri, 25 Mar 2022 16:54:28 +0100 Subject: [PATCH] added script to toggle 'jack-capture' --- toggle-jack-capture.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 toggle-jack-capture.sh diff --git a/toggle-jack-capture.sh b/toggle-jack-capture.sh new file mode 100755 index 0000000..49eb571 --- /dev/null +++ b/toggle-jack-capture.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +# author: Daniel Sommer +# license: MIT + +set -e + +dir="$(dirname $(realpath "$0"))" + +. "$dir/config.env" + +url="$(""$dir"/url.sh" "/systemd/jack-capture")" + +printf "> sending POST request to \'$url\'...${FONT_BOLD}" +[ "$(curl -X POST -s -f -w "\n%{http_code}" "$url" -d "state=toggle" | tail -n1)" -ne 200 ] && printf " error!\n" || printf " done!\n" \ No newline at end of file