diff --git a/routerbackup b/routerbackup index 5d6c47d..5afea6e 100755 --- a/routerbackup +++ b/routerbackup @@ -374,6 +374,10 @@ class AsaConfig(ConfigWithShell): for i in range(0, 5): if re.search('^\s*: Saved\s*$', shrun[i]): del shrun[0:i] + # strip garbage after ': end' line + for i in range(-2, -6, -1): # -2! (-1 would delete all if : end is on last line) + if re.search('^\s*: end\s*$', shrun[i]): + del shrun[i+1:] iproute = [] for cmd in ('sh ip address', 'sh route'):