Cant make enclosure plugin script work

Hello,
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/toggle_power.sh as the script

#!/bin/sh
curl -s -H "Content-Type: application/json" -H "X-Api-Key: 6B9F7__________5C430C2C8F" -X POST -d '{ "command":"togglePSU" }' -u login:password http://192.168.0.11/api/plugin/psucontrol

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

Can you help please ?