hmmm... isn't that already a good way to do it? After all, you could use a script like (just a barebone sketch - add error checking to your hearts content):
This command is not supposed to be used outside SMIT. Use a simple "nim" command, which is done in two steps: first allocate the resource on the nim server, then use it on the client: