Last active
November 11, 2025 22:47
-
-
Save lessavin/59ed97bb76c2226b7ed1568cf471f086 to your computer and use it in GitHub Desktop.
Expect script for restarting interface connection on Keenetic Start router.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/expect -f | |
| # interface-restart.exp | |
| # Expect script for restarting interface connection on Keenetic Start router. | |
| set host $env(KEENETIC_HOST) | |
| set port $env(KEENETIC_PORT) | |
| set login $env(KEENETIC_LOGIN) | |
| set password $env(KEENETIC_PASSWORD) | |
| set interface $env(KEENETIC_INTERFACE) | |
| set connection $env(KEENETIC_CONNECTION) | |
| spawn telnet $host $port | |
| sleep 5 | |
| expect "Login:" | |
| send "$login\r" | |
| expect "Password:" | |
| send "$password\r" | |
| expect ">" | |
| send "interface $interface connect via $connection\r" | |
| expect ">" | |
| send "exit\r" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment