Forum Discussion

rayrays_343509's avatar
rayrays_343509
Icon for Nimbostratus rankNimbostratus
Dec 12, 2017

[TMSH] create ltm rule and auto save (not enter vi editor)

Hi everyone.

 

I am trying to create an iRule and auto save data without enter editor model or any prompt (like: (save change? y/n/e ) at the TMOS .

 

But i can't find any way to resolve the question.

 

My script like:

 

root@(test)(cfg-sync In Sync)(Active)(/Common)(tmos) create ltm rule rule_name

 

Thanks in advance for your help.

 

  • I'm assuming you want the script to also contain the actual iRule code which you then plug into the "tmsh create /ltm rule..." command. If so, there's a good example here provided by Kevin Stewart. Basically, the script creates a properly formatted iRule in a temporary file (including newlines) and then imports that into the config via merge.

     

  • I'm not sure how to make your goal achieve.

     

    But when you create irule from CLI. it will take to vi editor for further to add event. If you find difficulty to understand the vi editor. You can right the irule in notepad and just copy n paste(right click) at the end :wq save n quit n y.I always use this.. ;)

     

  • thanks your answer and looking.

     

    crodriguez . thanks very much. your answer help me resolve the problem

     

    i execute the script at bash then avoid edit mode.

    tmsh create ltm rule test