JLindvig

Load pictures oneliner

May 13th, 2020
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.39 KB | None | 0 0
  1. cd /config/www/images/slides; query="{\"entity_id\": \"input_select.pictures\", \"options\": ["; files=""; for file in *.jpg; do files="$files,\"$file\""; done; files="${files:1}"; query="$query$files]}"; curl -X POST -H "Accept: application/json" -H "Authorization: Bearer DIT_API_TOKEN_HER" -H "Content-Type: application/json" -d "$query" http://DIN_HA_URL_HER/api/services/input_select/set_options
Add Comment
Please, Sign In to add comment