dotfiles/.local/bin/scripts/synct

10 lines
418 B
Plaintext
Raw Normal View History

2021-03-26 18:02:21 +00:00
#!/bin/sh
apikey=$(grep apikey $XDG_CONFIG_HOME/syncthing/config.xml | cut -d '>' -f2 | cut -d '<' -f1)
curl -H 'Content-Type: application/json' -H "X-API-Key: $apikey" "http://localhost:8384/rest/$1" "${@:2}" | bat --style=numbers -l json
2021-04-07 18:24:41 +00:00
# https://docs.syncthing.net/rest/db-browse-get.html
# synct 'db/browse?folder=data&levels=1'
# https://docs.syncthing.net/rest/db-need-get.html
# synct 'db/need?folder=music'