I made a script in python that uses the telnetlib module for telnetting into a linux device, running an install.sh file, then rebooting upon completion. Upon completeion of the install.sh script, I added a line that sends echo "install complete" to the terminal. Unfortunately, read_until("install complete") and expect(["install complete"]) don't detect this echo.
tn = telnetlib.Telnet(ip)
tn.read_until("login: ")
tn.write(user + "\n")
tn.read_until("Password: ")
tn.write(password + "\n")
tn.write("cd [file path to the install script]")#echoes "install complete" when finished
tn.write("./install.sh\n")
tn.read_until("install complete") #where the process hangs returns None if I add timeout parameter
Does telnetlib not reach echo statements or should I use another module or language? If I run the installer manually, I can confirm "install complete" echos as expected.