New backup 2025-04-24 13:15:02

This commit is contained in:
Penelope Gwen 2025-04-24 13:15:02 -07:00
parent cb8f4659e5
commit 4f4a6201ff

View file

@ -4,13 +4,15 @@
source "${HOME}/.secrets"
while getopts "a:e:d:s:" flag; do
while getopts "a:I:i:d:s:" flag; do
case $flag in
a)
action="${OPTARG}"
;;
e)
entity_id="${OPTARG}"
I)
identify_by="${OPTARG}"
i)
identifier="${OPTARG}"
;;
d)
domain="${OPTARG}"
@ -39,7 +41,7 @@ case "${action}" in
curl -s \
-H "Authorization: Bearer ${HA_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"entity_id": "'"${entity_id}"'"}' \
-d '{"'"${identify_by}"'": "'"${identifier}"'"}' \
"${HA_URL}/api/${action}/${domain}/${service}" | jq '.'
;;
esac