11 Replies Latest reply on Sep 11, 2015 9:46 PM by James Donohue

    Using IF with blcli_execute or reading a value from blcli_storeenv

    James Donohue

      I'm sure there's more efficient ways to do this but I'm going through the pains of learning BLCLI / NSH. I'm trying to determine if a Static Server group exists and if it doesn't, create it.


      I tried 2 methods for hours with no success:

      1. I'm using 3 lines with blcli_storeenv before I get to the following lines:


           blcli_execute StaticServerGroup groupExists "$PARENT_SERVER_GROUP/$SERVER_GROUP1" > Nul

           blcli_storeenv Result


      $Result returns a true (or false)

      When I use and If-then using $Result I get: command not found: true=false

      It seems the variable that gets created from blcli_storeenv is not a normal type variable.


           2. Tried including the command string directly within the IF-THEN statement block(tried many different combinations of this):

                if (blcli_execute StaticServerGroup groupExists "$PARENT_SERVER_GROUP/SERVER_GROUP1") == "false"; then

                          <create command here>



                Always a different syntax or parsing error.