image
image

Go Back   macosx.com > Scripts > Apple Scripts

Reply
 
LinkBack Thread Tools
  #1  
Old February 16th, 2009, 08:50 AM
KBug's Avatar
Registered User
 
Join Date: Nov 2008
Posts: 37
Thanks: 4
Thanked 0 Times in 0 Posts
KBug is on a distinguished road
Unable to reboot router from Terminal

I have this AppleScript to reboot my router, but for some strange reasons which I don't understand, the script doesn't reboot my router. Here is the script :
----------------------------------
tell application "Terminal"
run
do script "telnet 192.168.2.1"
delay 1
do script "admin" in window 1
delay 1
do script "MaccaM" in window 1
delay 1
do script "reboot" in window 1
delay 1
end tell
---------------------------------

Here is the output that I get when I run this script :



For your reference here are my router security settings :

Router is Airlink101 Super G Wireless Router
SSID is MacZone
SSID broadcast is disabled
Security Mode is WPA-PSK
Encryption Method is AES
Passphrase format is ASCII
Passphrase is MaccaM
Channel is 6-2437 Ghz
Mode is Mixed(g/b)

Can anyone please tell me why I am unable to reboot the router or is there any other way to reboot the router ?
Reply With Quote
  #2  
Old February 16th, 2009, 01:56 PM
Giaguara's Avatar
Chmod 760
 
Join Date: Nov 2002
Location: ~
Posts: 8,621
Thanks: 7
Thanked 99 Times in 98 Posts
Giaguara is a jewel in the roughGiaguara is a jewel in the roughGiaguara is a jewel in the rough
Can you reboot it via terminal and without AppleScript?
According to that terminal window the connection was refused.
__________________
MacBook Pro | Dell Mini Inspiron 9 | Mac Mini | Newton 2000 | iPhone | @Work : Dell D620 & 2x20" + a lot of Macs | Workstation, VC & Fusion
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do.
~ Samuel Clemens | Rants | Photos
Reply With Quote
  #3  
Old February 16th, 2009, 03:25 PM
nixgeek's Avatar
Mac of the SubGenius! :-)
 
Join Date: Jan 2004
Location: Miami, FL
Posts: 8,378
Thanks: 29
Thanked 142 Times in 126 Posts
nixgeek is a jewel in the roughnixgeek is a jewel in the roughnixgeek is a jewel in the rough
You sure you don't have to SSH into that router? Or maybe the Telnet feature is disabled?
__________________
Apple iMac G5 17" (2 GHz G5) - Mac OS X 10.4.11/Ubuntu 9.10
Asus Eee PC 901 (1.6 GHz Atom N270) - Ubuntu Netbook Remix 9.04
Apple Macintosh Quadra 650 (33 MHz MC68040) - Mac OS 8.1
"JHVH-1" (2 GHz AMD Athlon XP 2400+) - Slackware 13
"Kidbuntu" (2.8 GHz Celeron D 335) - Ubuntu 9.04
Reply With Quote
  #4  
Old February 16th, 2009, 03:45 PM
KBug's Avatar
Registered User
 
Join Date: Nov 2008
Posts: 37
Thanks: 4
Thanked 0 Times in 0 Posts
KBug is on a distinguished road
@Giaguara
The same things happens when I try to reboot directly from terminal. I get connection refused.

@nixgeek
How can I know that I have to SSh or Telnet is disabled ?
Reply With Quote
  #5  
Old February 16th, 2009, 04:06 PM
ElDiabloConCaca's Avatar
Registered User
 
Join Date: Aug 2001
Location: San Antonio, Texas
Posts: 12,678
Thanks: 7
Thanked 388 Times in 370 Posts
ElDiabloConCaca is a glorious beacon of lightElDiabloConCaca is a glorious beacon of lightElDiabloConCaca is a glorious beacon of lightElDiabloConCaca is a glorious beacon of lightElDiabloConCaca is a glorious beacon of lightElDiabloConCaca is a glorious beacon of light
Is configuring the router via SSH and/or Telnet even supported by the router? If so, it would say so in the manual...

Most home routers can only be accessed via a web interface on port 80 (or sometimes 8080). I have a D-Link DIR-625 that only supports configuration via web interface -- I cannot SSH or Telnet into it.
__________________
Mac mini 2.0GHz 10.6.2 • 4GB • 320GB • Superdrive • 4 x 1TB USB 2.0 • LED Cinema Display
MacBook 2.0GHz Core 2 Duo - White 10.6.2 • 4GB • 250GB • CD-RW/DVD-ROM
iPhone 3G 8GB • iPod Touch 8GB • iPod Photo 60GB • iPod nano 1GB • AT&T U-Verse 18Mb/2Mb
http://www.jeffhoppe.com
Reply With Quote
  #6  
Old February 17th, 2009, 12:50 AM
KBug's Avatar
Registered User
 
Join Date: Nov 2008
Posts: 37
Thanks: 4
Thanked 0 Times in 0 Posts
KBug is on a distinguished road
There is this Remote management setting in my Router config page, so I guess Telnet and SSH should be possible. Check here :

Reply With Quote
  #7  
Old February 17th, 2009, 01:10 AM
Giaguara's Avatar
Chmod 760
 
Join Date: Nov 2002
Location: ~
Posts: 8,621
Thanks: 7
Thanked 99 Times in 98 Posts
Giaguara is a jewel in the roughGiaguara is a jewel in the roughGiaguara is a jewel in the rough
Okay, remote management is enabled. So you can connect usually via browser to whatever IP it has. Does the manual say that that model actually supports ssh or telnet for remote connection?
__________________
MacBook Pro | Dell Mini Inspiron 9 | Mac Mini | Newton 2000 | iPhone | @Work : Dell D620 & 2x20" + a lot of Macs | Workstation, VC & Fusion
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do.
~ Samuel Clemens | Rants | Photos
Reply With Quote
  #8  
Old February 17th, 2009, 01:21 AM
KBug's Avatar
Registered User
 
Join Date: Nov 2008
Posts: 37
Thanks: 4
Thanked 0 Times in 0 Posts
KBug is on a distinguished road
No the manual doesn't mention anything about remote connection. My router is Super G Wireless Broadband Router Model #AR430W from Airlink101 (www.airlink101.com).
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump


All times are GMT -5. The time now is 12:51 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC1
Copyright 2000-2010 DigitalCrowd, Inc.