File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
lib/msf/ui/console/command_dispatcher Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -1653,16 +1653,15 @@ def cmd_unload(*args)
1653
1653
return false
1654
1654
end
1655
1655
1656
- # Walk the plugins array
1657
- framework . plugins . each { |plugin |
1658
- # Unload the plugin if it matches the name we're searching for
1659
- if ( plugin . name . downcase == args [ 0 ] . downcase )
1660
- print ( "Unloading plugin #{ args [ 0 ] } ..." )
1661
- framework . plugins . unload ( plugin )
1662
- print_line ( "unloaded." )
1663
- break
1664
- end
1665
- }
1656
+ # Find a plugin within the plugins array
1657
+ plugin = framework . plugins . find { |p | p . name . downcase == args [ 0 ] . downcase }
1658
+
1659
+ # Unload the plugin if it matches the name we're searching for
1660
+ if plugin
1661
+ print ( "Unloading plugin #{ args [ 0 ] } ..." )
1662
+ framework . plugins . unload ( plugin )
1663
+ print_line ( "unloaded." )
1664
+ end
1666
1665
end
1667
1666
1668
1667
#
You can’t perform that action at this time.
0 commit comments