cancel
Showing results for 
Search instead for 
Did you mean: 

Problem this snippet solves:

This example shows how to automatically remove any pools beginning with a given string.

Code :

proc script::run {} {
    if { $tmsh::argc < 2 } {
       puts "Requires one argument: "
   } else {
       set poolstring [lindex $tmsh::argv 1]
       set len [expr { [string length $poolstring] - 1 }]
   }
   foreach {pool} [tmsh::get_config /ltm pool] {
       if { [string range [tmsh::get_name $pool] 0 $len] equals $poolstring } {
           tmsh::delete ltm pool [tmsh::get_name $pool]
       }
    }
}

proc script::help {} {
    tmsh::add_help "Delete a list of pools beginning with specified string\n\
       " 
}
Version history
Last update:
‎10-Mar-2015 12:03
Updated by:
Contributors