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"
|
||||
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue