> What do you mean by prompt? Just the first message that is sent when
> you connect? How configurable would you expect this to be?
Well, I mean something like a shell prompt.
When you telnet to port 4555, you get no prompt.
If you telnet to Linux which bash shell, you might get the '-bash-3.00% ' prompt
(for example).
When using the Perl Net::Telnet module, it wants and expects a prompt to be
defined so it knows when it can send the next list of characters for a command.
So for example, if I could configure the prompt to be 'james> ', then this can
happen in my terminal:
-bash-3.00$ telnet localhost 4555
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
JAMES Remote Administration Tool 2.2.0
Please enter your login and password
Login id:
root
Password:
********
Welcome root. HELP for a list of commands
james> listusers
Existing accounts 1
user: jamesadmin
james> quit
Bye
Connection closed by foreign host.
-bash-3.00$
* Note, the appearance of 'james> ' is a prompt I would like to have defined.
Currently you are given nothing to prompt you that you can start entering a command.
And then I could make a little PERL script to shutdown JAMES like this:
-bash-3.00$ cat james-shutdown.pl
##!/bin/bash
use Net::Telnet;
use strict;
my $telnet = new Net::Telnet (
Host => "localhost",
Port => "4555",
Prompt => "/^james>/");
$telnet->open();
$telnet->waitfor(/Login id:\s*\n/);
$telnet->print("root");
$telnet->waitfor(/Password:\s*\n/);
$telnet->print("********");
$telnet->cmd("shutdown");
print $telnet->getlines();
$telnet->close();
__END__
-bash-3.00$
So you can see one importance of having a defined prompt for the administrative
shell on telnet:4555 JAMES admin service.
If we admins want to execute automated tasks, like shutdown, add user, from
other programs/scripts, we need a prompt to appear to tell the script when it
can input information.
So I ask again. Can a shell prompt for the JAMES admin service on port 4555 be
defined? How can I do this?
Actually, I do not really care too much what the prompt is. I just want a
prompt.
-RG
Serge Knystautas wrote:
On 8/17/05, Russell E Glaue <[EMAIL PROTECTED]> wrote:
Who can tell me (without having to change the source code) how to define
a prompt the telnet service JAMES has on port 4555 for administration?
Is it possible to set the prompt? Configure a prompt somewhere?
If not, can this be added into a future release of JAMES so that
administrators can define a prompt if they like?
Anyone have any philosophy on this matter?
What do you mean by prompt? Just the first message that is sent when
you connect? How configurable would you expect this to be?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]