File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
modules/post/windows/manage Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -164,17 +164,20 @@ def delete_route(opts={})
164
164
# @return [void] A useful return value is not expected here
165
165
def autoadd_routes
166
166
switch_board = Rex ::Socket ::SwitchBoard . instance
167
- print_status ( "Searcing for subnets to auto route." )
167
+ print_status ( "Searcing for subnets to autoroute." )
168
+ found = false
169
+
168
170
session . net . config . each_route do | route |
169
171
# Remove multicast and loopback interfaces
170
172
next if route . subnet =~ /^(224\. |127\. )/
171
173
next if route . subnet == '0.0.0.0'
172
174
next if route . netmask == '255.255.255.255'
173
175
174
- if not switch_board . route_exists? ( route . subnet , route . netmask )
176
+ if ! switch_board . route_exists? ( route . subnet , route . netmask )
175
177
begin
176
178
if Rex ::Socket ::SwitchBoard . add_route ( route . subnet , route . netmask , session )
177
179
print_good ( "Route added to subnet #{ route . subnet } /#{ route . netmask } " )
180
+ found = true
178
181
else
179
182
print_error ( "Could not add route to subnet #{ route . subnet } /#{ route . netmask } " )
180
183
end
@@ -184,6 +187,7 @@ def autoadd_routes
184
187
end
185
188
end
186
189
end
190
+ print_status ( "Did not find any new subnets to add." ) if !found
187
191
end
188
192
189
193
# Validates the command options
You can’t perform that action at this time.
0 commit comments