From 4451dcc606b6c29d4089a1bff94093fd846065da Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Thu, 17 Sep 2020 09:42:23 -0600 Subject: [PATCH] improved sending multiple commands on single pompt --- cisco_wifi_ctl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cisco_wifi_ctl.py b/cisco_wifi_ctl.py index 8188812a..c3e8ffca 100755 --- a/cisco_wifi_ctl.py +++ b/cisco_wifi_ctl.py @@ -813,20 +813,20 @@ def main(): if i == 0: print("elevated to (config)#") command = "wlan %s %s %s"%(args.wlan, args.wlanID, args.wlan) + print("open network command {}".format(command)) egg.sendline(command) - j = egg.expect_exact(["(config-wlan)#",pexpect.TIMEOUT],timeout=2) + j = egg.expect_exact(["WLC(config-wlan)#",pexpect.TIMEOUT],timeout=2) if j == 0: for command in ["shutdown","no security wpa","no security wpa wpa2","no security wpa wpa2 ciphers aes", "no security wpa akm dot1x","no shutdown","end"]: egg.sendline(command) sleep(0.1) - k = egg.expect_exact(["(config-wlan)#",pexpect.TIMEOUT],timeout=2) + k = egg.expect_exact(["WLC(config-wlan)#",pexpect.TIMEOUT],timeout=2) if k == 0: print("command sent: {}".format(command)) - egg.sendline("end") if k == 1: print("command time out: {}".format(command)) - egg.sendline("end") + egg.sendline("end") if j == 1: print("did not get the (config-wlan)# prompt") if i == 0: