Created
March 26, 2014 15:59
-
-
Save javikalsan/9786684 to your computer and use it in GitHub Desktop.
Simple Bash Script to execute a command on the router through telnet command
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
#!/bin/sh | |
# replace cmd1 for the command to execute | |
host=192.168.1.1 | |
port=23 | |
user=myuser | |
pass=mypass | |
cmd1='ifconfig wl0 down' | |
( echo open ${host} | |
sleep 1 | |
echo ${user} | |
sleep 1 | |
echo ${pass} | |
sleep 1 | |
echo ${cmd1} | |
sleep 2 | |
) | telnet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment