Forum Discussion

Vegard_75001's avatar
Vegard_75001
Icon for Nimbostratus rankNimbostratus
Sep 10, 2009

adding long iRules from shell

I want to add iRules from the shell, preferably from a file. What I've managed to do so far is:

 

 

b rule my_rule `cat file.rule`

 

 

This works, but since the shell command can only be 1024 long, it won't work for long scripts.

 

 

I thought

 

 

b rule my_rule

 

would work, but it didn't.

 

 

Any other way to add a long script from shell?
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    Are you trying to script the changes without reloading the config?

     

     

    Could you just edit the bigip.conf file and reload it using 'b load'? Else, maybe you could create a simple iControl script which reads file.rule and modifies the config.

     

     

    Aaron
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    I'm with the other posters...is there a particular reason that you're looking to add iRules from a file via the command line rather than putting them into the conf directly or, my preference, using the iRule editor?

     

     

    Colin
  • Jonas_Karlsson1's avatar
    Jonas_Karlsson1
    Historic F5 Account
    If you have your rule(s) in a text file with the same format as bigip.conf you can just do "b merge filename" and "b save".

     

    WIth iRules you can, but you don't have to :-)