If you know how to execute shell script from C++ function, you will be able to execute it from Oracle function.
I think you have to write C++ external function which makes it for you.