Help with exec.whitelist

Hi Everyone hoping for some help with my exec.whitelist file

Created Misc Directory

[22:46:44] sharpy@openhabian:/etc/openhab2$ mkdir misc

created file exec.whitelist

added items (Unsure if its right)

/usr/bin/curl -X POST --data-binary {\"jsonrpc\":\"2.0\",\"method\":\"VideoLibrary.Scan\",\"id\":\"mybash\"} -H content-type:application/json http://USER:PASS@192.168.0.15:8080/jsonrpc > NUL 2>&1", interval=0 , timeout=5, autorun=false]
/usr/bin/curl -X POST --data-binary {\"jsonrpc\":\"2.0\",\"method\":\"VideoLibrary.Clean\",\"id\":\"mybash\"} -H content-type:application/json http://USER:PASS@192.168.0.15:8080/jsonrpc > NUL 2>&1", interval=0 , timeout=5, autorun=false]
/usr/bin/curl -X POST --data-binary {\"jsonrpc\":\"2.0\",\"method\":\"VideoLibrary.Scan\",\"id\":\"mybash\"} -H content-type:application/json http://USER:PASS@192.168.0.27:8080/jsonrpc > NUL 2>&1", interval=0 , timeout=5, autorun=false]
/usr/bin/curl -X POST --data-binary {\"jsonrpc\":\"2.0\",\"method\":\"VideoLibrary.Clean\",\"id\":\"mybash\"} -H content-type:application/json http://USER:PASS@192.168.0.27:8080/jsonrpc > NUL 2>&1", interval=0 , timeout=5, autorun=false]
/usr/bin/curl -X POST --data-binary {\"jsonrpc\":\"2.0\",\"method\":\"VideoLibrary.Scan\",\"id\":\"mybash\"} -H content-type:application/json http://USER:PASS@192.168.0.26:8080/jsonrpc > NUL 2>&1", interval=0 , timeout=5, autorun=false]
/usr/bin/curl -X POST --data-binary {\"jsonrpc\":\"2.0\",\"method\":\"VideoLibrary.Clean\",\"id\":\"mybash\"} -H content-type:application/json http://USER:PASS@192.168.0.26:8080/jsonrpc > NUL 2>&1", interval=0 , timeout=5, autorun=false]

You probably need to remove the backslashes, and you certainly need to remove the extraneous bits at the end of each line.

/usr/bin/curl -X POST --data-binary {"jsonrpc":"2.0","method":"VideoLibrary.Scan","id":"mybash"} -H content-type:application/json http://USER:PASS@192.168.0.15:8080/jsonrpc > NUL 2>&1
1 Like

Hi @namraccr thanks for the reply

quote=“Sharpy, post:1, topic:93307”]
/usr/bin/curl -X POST --data-binary {“jsonrpc”:“2.0”,“method”:“VideoLibrary.Scan”,“id”:“mybash”} -H content-type:application/json http://USER:PASS@192.168.0.15:8080/jsonrpc > NUL 2>&1", interval=0 , timeout=5, autorun=false] /usr/bin/curl -X POST --data-binary {“jsonrpc”:“2.0”,“method”:“VideoLibrary.Clean”,“id”:“mybash”} -H content-type:application/json http://USER:PASS@192.168.0.15:8080/jsonrpc > NUL 2>&1", interval=0 , timeout=5, autorun=false] /usr/bin/curl -X POST --data-binary {“jsonrpc”:“2.0”,“method”:“VideoLibrary.Scan”,“id”:“mybash”} -H content-type:application/json http://USER:PASS@192.168.0.27:8080/jsonrpc > NUL 2>&1", interval=0 , timeout=5, autorun=false] /usr/bin/curl -X POST --data-binary {“jsonrpc”:“2.0”,“method”:“VideoLibrary.Clean”,“id”:“mybash”} -H content-type:application/json http://USER:PASS@192.168.0.27:8080/jsonrpc > NUL 2>&1", interval=0 , timeout=5, autorun=false] /usr/bin/curl -X POST --data-binary {“jsonrpc”:“2.0”,“method”:“VideoLibrary.Scan”,“id”:“mybash”} -H content-type:application/json http://USER:PASS@192.168.0.26:8080/jsonrpc > NUL 2>&1", interval=0 , timeout=5, autorun=false] /usr/bin/curl -X POST --data-binary {“jsonrpc”:“2.0”,“method”:“VideoLibrary.Clean”,“id”:“mybash”} -H content-type:application/json http://USER:PASS@192.168.0.26:8080/jsonrpc > NUL 2>&1", interval=0 , timeout=5, autorun=false]
[/quote]

I have just tried that it still says the same not contained in whitelist

usr/bin/curl -X POST --data-binary {\"jsonrpc\":\"2.0\",\"method\":\"VideoLibrary.Scan\",\"id\":\"mybash\"} -H content-type:application/json http://USER:PASS@192.168.0.15:8080/jsonrpc
usr/bin/curl -X POST --data-binary {\"jsonrpc\":\"2.0\",\"method\":\"VideoLibrary.Clean\",\"id\":\"mybash\"} -H content-type:application/json http://USER:PASS@192.168.0.15:8080/jsonrpc
curl -X POST --data-binary {\"jsonrpc\":\"2.0\",\"method\":\"VideoLibrary.Scan\",\"id\":\"mybash\"} -H content-type:application/json http://USER:PASS@192.168.0.15:8080/jsonrpc
curl -X POST --data-binary {\"jsonrpc\":\"2.0\",\"method\":\"VideoLibrary.Clean\",\"id\":\"mybash\"} -H content-type:application/json http://USER:PASS@192.168.0.15:8080/jsonrpc

Tried both variations

You see that the two things you just quoted don’t match, right?

The first set starts with usr/bin/curl while the second starts with curl -X

@namraccr It was just something else I tried wondering if it would work :slight_smile:

I tried the first one and then tried the second one just wondering thought i would post it JIC

Has anyone got anymore pointers this is something I haven’t got a clue about

Try the latest snapshot of the binding that has a fix for loading the whitelist at startup. It was only built a few hours ago.

Hi again @namraccr

I have uninstalled the binding , downloaded and added V2.5.3 Snapshot Binding but i’m still unsure on exactly what too write in the whitelist

I have managed too stop it too warning me that its not contained in the whitelist but it no longer runs

exec.whitelist

/usr/bin/curl -X POST --data-binary {"jsonrpc":"2.0","method":"VideoLibrary.Scan","id":"mybash"} -H content-type:application/json http://USER:PASS@192.168.0.15:8080/jsonrpc > NUL 2>&1

exec.things

Thing exec:command:kodidbupdate "Database Update" @ "Living Room" [command="/usr/bin/curl -X POST --data-binary {\"jsonrpc\":\"2.0\",\"method\":\"VideoLibrary.Scan\",\"id\":\"mybash\"} -H content-type:application/json http://USER:PASS@192.168.0.15:8080/jsonrpc > NUL 2>&1", interval=0 , timeout=5, autorun=false]