Skip to content

Commit

Permalink
fix ifttt
Browse files Browse the repository at this point in the history
  • Loading branch information
randName committed Apr 5, 2020
1 parent 9df031e commit 5e55ca9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/ifttt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ _json () {
local a=$1
local b=$2
shift 2
cat <<-EOF
{"value1":"$a","value2":"$b","value3":"$@"}
EOF
echo '{"value1":"'$a'","value2":"'$b'","value3":"'$@'"}'
}

if [ $# -eq 3 ]; then
Expand All @@ -22,4 +20,6 @@ else
data="$( _json "$(hostname)" "$(pwd)" "$@" )"
fi

curl -s -H 'Content-Type: application/json' -o /dev/null -d "$data" "$API"
result="$(curl -s -H 'Content-Type: application/json' -d $data $API)"
[ "$result" = 'Bad Request' ] && exit 1
exit 0

0 comments on commit 5e55ca9

Please sign in to comment.