Forum Discussion
Kevin_Stewart
May 02, 2014Employee
Okay, this is wildly simplistic, but take a look:
!/bin/bash
current_rules=`tmsh list ltm virtual $1 one-line all-properties |perl -ne 'print "$1" if /rules {(.*?)}/'`
tmsh modify ltm virtual $1 rules { $current_rules $2 }
There's no error checking here, so you'd need to add it. The above takes the VIP name as the first param ($1) and the new iRule as the second ($2). The first line extracts the current iRules form the given VIP into a variable, and then adds them back in with the second line.