Forum Discussion
Running BASH commands via REST API
Hi Tim,
Take a look to the example below to see the required format of the request...
curl -vsk -u 'admin:admin' -H "Content-Type: application/json" -X POST https://YOURDEVICE/mgmt/tm/util/bash -d "{\"command\":\"run\",\"utilCmdArgs\":\"-c 'echo "Hello World!"'\"}"
Cheers, Kai
- Nikoolayy1Jan 24, 2023MVP
I also needed this as I was getting the same error , when trying to start bash scripts with REST-API. The other idea I was going to try is to use tmsh script (https://clouddocs.f5.com/api/tmsh/script__run.html ) as the example https://community.f5.com/t5/codeshare/creating-a-tmsh-script-with-icontrol-rest-and-using-it-to/ta-p/290984 and use the "tmsh::run util bash -c " in the script then trigger with API endpoint "mgmt/tm/cli/script" but that seemed too complex for a simple bash command.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com