New backup 2025-04-24 13:15:02
This commit is contained in:
parent
cb8f4659e5
commit
4f4a6201ff
1 changed files with 6 additions and 4 deletions
|
@ -4,13 +4,15 @@
|
||||||
|
|
||||||
source "${HOME}/.secrets"
|
source "${HOME}/.secrets"
|
||||||
|
|
||||||
while getopts "a:e:d:s:" flag; do
|
while getopts "a:I:i:d:s:" flag; do
|
||||||
case $flag in
|
case $flag in
|
||||||
a)
|
a)
|
||||||
action="${OPTARG}"
|
action="${OPTARG}"
|
||||||
;;
|
;;
|
||||||
e)
|
I)
|
||||||
entity_id="${OPTARG}"
|
identify_by="${OPTARG}"
|
||||||
|
i)
|
||||||
|
identifier="${OPTARG}"
|
||||||
;;
|
;;
|
||||||
d)
|
d)
|
||||||
domain="${OPTARG}"
|
domain="${OPTARG}"
|
||||||
|
@ -39,7 +41,7 @@ case "${action}" in
|
||||||
curl -s \
|
curl -s \
|
||||||
-H "Authorization: Bearer ${HA_TOKEN}" \
|
-H "Authorization: Bearer ${HA_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"entity_id": "'"${entity_id}"'"}' \
|
-d '{"'"${identify_by}"'": "'"${identifier}"'"}' \
|
||||||
"${HA_URL}/api/${action}/${domain}/${service}" | jq '.'
|
"${HA_URL}/api/${action}/${domain}/${service}" | jq '.'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Add table
Reference in a new issue