Commit 32caa914 authored by nimrod's avatar nimrod
Browse files

Fix the Kodi library scan function.

The script in Poquita only scans the audio library. The one in the
Transmission image requires some environment variables and also sends a
notification to Nextcloud. So fallback to using cURL.
parent 7d76c541
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -116,7 +116,6 @@ alias green="printf '\e[1;92m%s\e[0m\n'"
alias hcl2json='json2hcl -reverse'
alias hostlocal='docker run --rm --privileged --net=host docker.io/gliderlabs/hostlocal'
alias jjb='jenkins-jobs'
alias kodi_scan="docker --host=ssh://kodi.shore.co.il exec poquita-poquita-1 kodi_scan"
alias l='ls -F'
alias la='ls -AF'
alias lh='ls -lhAS'
@@ -230,6 +229,13 @@ gen_csr () {
    openssl req -new -newkey rsa:4096 -nodes -out "$name.csr" -keyout "$name.key"
}

kodi_scan () {
    # shellcheck disable=SC1083
    ssh kodi.shore.co.il curl --silent --fail --show-error --json \'{\"jsonrpc\": \"2.0\", \"id\": \"transmission\", \"method\": \"VideoLibrary.Scan\"}\' http://127.0.0.1:8080/jsonrpc; echo
    # shellcheck disable=SC1083
    ssh kodi.shore.co.il curl --silent --fail --show-error --json \'{\"jsonrpc\": \"2.0\", \"id\": \"transmission\", \"method\": \"AudioLibrary.Scan\"}\' http://127.0.0.1:8080/jsonrpc; echo
}

match_ssl_pair () {
    if [ "$#" -ne 2 ]
    then