Leopard and telnet scripts

countdrachma

Registered
I'm a newbie to Mac OS and am having some difficulty in establishing a terminal session that then runs a telnet command to access a remote device. I want to have multiple icon / scripts within a Stack on the Dock whereby each icon initiates a separate telnet connection to a specific device.

I'm sure this is easy, but to the uninitiated, the help files are a bit vague.

Thanks in advance for your help.
 
Well when you want to get to a server you have several ways. Logging into then depend on how they are formatted and Windows server require logging into and such. There is the Finder's "Connect to Server" (command button+k) or Finder menu item->Go->Connect to Server.

If you are on a Windows Domain check out the cross platform sharing howto site MacWindows.com. They have been adding Macs to Windows computers for over a decade.

Once you log into a server, let your Mac save the password. Once you mount the server on your Desktop, Make an Alias (Alias in a Mac is the same a shortcut in Windows). Then drop that Alias in a folder then drag that folder to the dock or folder and then drag that folder to the Dock. Once you have the alias to the dock just click on it. If you saved the password it will mount.

Tell us what kind of server connection you are making and we will give you specific instructions to logging onto that server.

If you are new to Macs, try getting David Pogue' s: Mac OS X Leopard: The Missing Manual when it comes out. you you read one of /David's books, you will most definitely be "up to speed". Plus people on the board have been using Mac since the beginning.

Good Luck.
 
Thanks Satcomer. I think I might need to elaborate a bit though. I don't have a requirement to actually connect to a server but rather open numerous telnet sessions (via the internet) to one address on numerous ports. This I'd like represented via a seperate "icon" for each port / connection. For example, I'd like to be able to "double-click" (excuse the Windows-centric terminology) an icon in the dock that opens a terminal window that then runs a telnet x.x.x.x yy (IP address / port) command from within the terminal window and connects me. I would need multiple icons, each one representing a different telnet x.x.x.x y.y parameter.

I hope that clarifies my requirements for you a bit more and would be most appreciative of any follow-up advice you might have, based on this additional info.

Thanks again for your help.
 
... I don't have a requirement to actually connect to a server but rather open numerous telnet sessions (via the internet) to one address on numerous ports. ...
Mac users have been double-clicking since 1984.

Now back to the question at hand. Nobody establishes a telnet session just to establish a telnet session. You establish a telnet session to work or play on a remote computer. Are you running a commandline application? Are you trying to start X-Windowing sessions? What? If you tell us how you are using telnet, then you are more likely to get the help you need.
 
OK, my apologies if I'm coming across as a bit vague. I telnet to a terminal server that initiates reverse telnet sessions to console ports on cisco routers. I telnet to the same address but on a different port and the terminal server then initiates a reverse telnet session to a console line directly attached to it. This is a CLI connection only. No need for any X-Windows GUI or the like. Therefore, my requirement is to have a link I can click that establishes the telnet session to the terminal server on a specific port. The terminal server takes care of the rest. I hope this clarifies my requirement and thank everyone so far who has tried to obtain an understanding of this, vague as I may have been.
 
Hey there -

See if this thread answers your question -- you basically save a set of .term files, each with a specific command which executes at startup. For example, you could save "telnet 10.1.1.1 201", "telnet 10.1.1.1 202" etc. as your commands....
 
Thanks macbri. You've nailed my requirements. However, being Leopard, there doesn't seem to be a menu within Terminal that offers the option to "save as", nor can I find any info on saving a .term file. I'm almost about ready to give up and look for some third party telnet applications. SecureCRT is what I've always used on a Windows platform and it is great. Hopefully I can find some kind of tab capable telnet app for Mac OS.

Appreciate your help. Thanks
 
Sorry it wasn't more help -- maybe some kind soul with Leopard already installed can see if Terminal has another way of saving a "ready-to-run" command? All I found was a reference to saving "profiles":

Shell->Save Profile

See if that helps...
 
Thanks again macbri. No luck with the Shell -> Save Profile under the Leopard menu structure. Without having any previous exposure to 10.4, I can't compare old menus to the new Leopard one and unfortunately there doesn't seem to be too many out there running Leopard yet.

Cheers
 
Looks like Save Windows as Group... is your best bet.
A window group is a configuration of one or more Terminal windows. Use the "Save as Window Group..." item in the Window menu to save a new one.

Also, AppleScript has a lot you can do to script Terminal. Maybe you can call up a telnet session without opening the terminal directly.

New Remote Connection... under the Shell menu gets you a Connect to server window, with an address line to set up your telnet connection easily. Then "Save as Window Group", and name each group file as your desired telnet connection. Seems like that should work for you....
 
Thanks DeltaMac. I have tried that and whilst you'd think that would be exactly what I'm after, it doesn't work. I set up new remote connections from within the Shell menu and then saved all the open connected windows as a Window Group. However, when you then open the window group, it merely opens the terminal windows at the shell prompt and doesn't actually initiate the telnet command / connection. Hence, I just get a number of terminal windows where I then have to enter the telnet commands in each. Frustrating! I think I'm going to have to learn how to use AppleScript, I guess. Thanks for the attempt though, I really appreciate it.
 
But - if you are connected to a server, that server should show as an icon on your network.
Make an alias of each server connection from your Network. Name the aliases as you wish for each connection, and move those aliases to your desktop. Does that provide you with a simpler way to re-connect? (I'm not sure if you can create an alias that would work to connect to a telnet session, but there's a lot of things I don't know...:) ) Seems like it should work, and a lot simpler than what you're trying...
 
Back
Top