Cisco, Telnet, and Bash Scripting
I'm a cisco guy, and I know linux very well, just not bash scripting. What I need is a script (disconnect.sh and connect.sh) that will telnet into a switch and disable a port given an arguement.
So if type disconnect room16, it will go into a text file (switches.conf) and look for the given argument and load the ip to telnet to, and the port to shutdown. The layout of the text file should look something like this, maybe tab delineated. Code:
#switches.conf Now I know I need to use the expect command once I invoke telnet, but I haven't even gotten the above to work. |
Save this as something like "switch.sh"
Code:
#!/bin/bash Run it: switch.sh Room1 |
Code:
#!/bin/bash |
All times are GMT -5. The time now is 05:50 PM. |