Forum Discussion
iControlREST (11.5) - execute bash command
I've been playing with iControlREST recently, and trying to port some old iControl scripts over. Most of them work nicely, but I've got one that requires running a bash command (for example purposes, let's say in the tmsh shell, the command would be
run /util bash -c 'echo "works"'
.
Is it possible to run a bash command through iControlREST?
- Kevin_StewartEmployee
Try this:
curl -vsk -u 'admin:admin' -H "Content-Type: application/json" -X POST https://192.168.1.252/mgmt/tm/util/bash -d "{\"command\":\"run\",\"utilCmdArgs\":\"-c 'echo "works"'\"}"
You're somewhat limited with what you can do with Bash, for example you couldn't directly execute a binary file like 'ls', but then you could script it and then call the script:
https://devcentral.f5.com/questions/can-icontrol-rest-delete-a-connection
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