Forum Discussion
1 Reply
Sort By
- RicoCirrus
KWH,
It seems like what you are looking for is the iRules 'catch' statement. This will try to run a piece of code and check for any runtime errors. If there is any error, it will run a second block of code instead. This will help you check if a certain policy exists. I haven't properly tested this code, but I believe your solution should look something like this.
if { [catch { ASM::enable $policy log local0. "$policy was enabled" }] } then { This block only triggers if the above code would fail log local0. "$policy does not exist" }
More information here, if you would like to research some more yourself.