corz.org text viewer..
[currently viewing: /public/docs/comms/router/shell scripts/rr.sh - raw]
 
#!/bin/sh

#
# reboot the router v0.2
#
# the trick to this technique, is...
# (drum roll please) a DELAY after the commands. 
# well, it works for me ;o)
###

###
# drop this script into your PATH somewhere, and make it executable
# cp rr /usr/local/bin/rr
# chmod +x /usr/local/bin/rr
#
# to reboot the router, simply type "rr" from your shell.
#

# prefs..

#router="router"
router="192.168.1.1"
user="admin"
password="admin"
command="reboot"

# let's go..
{
    sleep 1;
    echo $user
    sleep 1;
    echo $password
    sleep 1;
    echo $command
    sleep 1;
    
} | telnet $router

# fin