From 8333416479ea079cf0dfe42a4e9a059ea3fb8908 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Sun, 15 Dec 2019 08:22:50 -0800 Subject: [PATCH] Add another expect pattern to catch when we loose connection. --- cisco_wifi_ctl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cisco_wifi_ctl.py b/cisco_wifi_ctl.py index 3543a8e7..a720ea17 100755 --- a/cisco_wifi_ctl.py +++ b/cisco_wifi_ctl.py @@ -166,6 +166,7 @@ def main(): EXITPROMPT = "Would you like to save them now\? \(y/N\)" AREYOUSURE = "Are you sure you want to continue\? \(y/n\)" CLOSEDBYREMOTE = "closed by remote host." + CLOSEDCX = "Connection to .* closed." egg.expect(CCPROMPT) logg.info("Ap[%s] Action[%s] Value[%s] "%(args.ap, args.action, args.value)) @@ -228,7 +229,7 @@ def main(): egg.sendline("y") egg.sendline("logout") - i = egg.expect([EXITPROMPT, CLOSEDBYREMOTE]) + i = egg.expect([EXITPROMPT, CLOSEDBYREMOTE, CLOSEDCX]) if i == 0: egg.sendline("y")