I think I figured out half of it: echo "/iscsi create iqn.2003-01.org.nobody:one" | targetcli This works, and exits. however, a failure, such as: echo "lsa" | targetcli Will result in an error in the output: "Command not found lsa" But return code is 0. Still, I can work with this. On Fri, Oct 11, 2013 at 10:09 AM, Seth Call <sethcall@xxxxxxxxx> wrote: > I'm porting an application which runs on OpenIndiana. In OpenIndiana, > we just invoke itadm and stmfadm to create and destroy ISCSI targets. > > The command targetcli, however, seems a bit unfriendly to scripting in > this fashion, seeing how it's interactive and all. > > I found this patch, and applied it, and it's allowed me to invoke > targetcli as a one-liner, like: > > targetcli /iscsi create iqn.a.b.c:x > > Unfortunately, if the command fails, the exit code is still always 0. > patch: http://www.spinics.net/lists/target-devel/msg01554.html > > But forget my approach for a second--I feel I might be missing how > this is usually done. Does anyone script using targetcli, or do they > use some other command instead? > > Thanks much, > Seth -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html