#!/usr/bin/expect -f############################################################################ Name: dsl502t-reboot (install in /usr/local/bin, owner:group root.root# and file perms 700)# Purpose: Reboot the DLink 502T ADSL modem/router# Author: Arun Khan (knura at yahoo dot com)# Warranty: None - if it breaks your system, you get to keep all the #pieces :)# Usage: Create a file with the following lines and install it in# /etc/cron.d - do not forget to remove "#" for the 2 entries############################################################################ reboot MTNL ADSL modem#1 0 * * * root /usr/local/bin/dsl502t-reboot#59 7 * * * root /usr/local/bin/dsl502t-reboot############################################################################ change the ip number if differentspawn telnet 192.168.1.1expect "ogin:" { send "root\r" }# change the password if differentexpect "ssword:" { send "admin\r" }expect "#" { send "reboot\r" }expect eof