HungrySkeltal
Dabbler
- Joined
- Apr 17, 2020
- Messages
- 11
Hi all,
I'm attempting to use the REST API v2.0 to get the current state of the unbound service running in my unbound jail.
By SSHing into FreeNAS, I can type: and receive the response
So I'm attempting to replicate this behaviour via curl, however my best attempts only return an integer value (e.g. '5880'), not the actual 'unbound is running' text.
This is my curl command (user and password redacted of course):
Is there something I'm missing here that will allow me to get the text response?
Any help would be awesome - thanks :)
I'm attempting to use the REST API v2.0 to get the current state of the unbound service running in my unbound jail.
By SSHing into FreeNAS, I can type:
Code:
iocage exec unbound 'service unbound status'
Code:
unbound is running as pid 50903.
So I'm attempting to replicate this behaviour via curl, however my best attempts only return an integer value (e.g. '5880'), not the actual 'unbound is running' text.
This is my curl command (user and password redacted of course):
Code:
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST http://192.168.1.5/api/v2.0/jail/exec -u USERNAME:PASSWORD -d "{ \"jail\": \"unbound\", \"command\": [ \"service unbound status\" ]}"
Is there something I'm missing here that will allow me to get the text response?
Any help would be awesome - thanks :)