Moin,
ich werde gerade nicht schlau draus, vielleicht kann mir ja jemand helfen. Wenn ich den Command rein schreibe funktioniert es.
1 2 3 | regcmd=“/home/user/script.sh <host>“ curl -s -k -H 'Content-Type: application/json' -H 'X-Auth-Token: TOKEN‘ -d '{"command": '"$regcmd"'}‘ https://bliblablub.test:8080/execute |
Resultat
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <title>400 Bad Request</title> <h1>Bad Request</h1> <p>Failed to decode JSON object: Expecting value: line 1 column 13 (char 12)</p>
Merci