Cant make enclosure plugin script work

i try to togglePSU from plugin PSU control with an output in enclosure plugin. the idea is to have a momentary button to toggle PSU

I'm having an output (Shell Script ) with /usr/local/bin/ as the script

curl -s -H "Content-Type: application/json" -H "X-Api-Key: 6B9F7__________5C430C2C8F" -X POST -d '{ "command":"togglePSU" }' -u login:password

It works only if i kill the running task, and the script works if i launch it in a terminal.

Can you help please ?