projects
/
clearscm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added sys alias
[clearscm.git]
/
lib
/
Rexec.pm
diff --git
a/lib/Rexec.pm
b/lib/Rexec.pm
index
71fdd22
..
2eecab8
100644
(file)
--- a/
lib/Rexec.pm
+++ b/
lib/Rexec.pm
@@
-160,16
+160,18
@@
our @EXPORT = qw (
my @lines;
my @lines;
-sub _debug ($) {
\r
+sub _debug ($) {
my ($msg) = @_;
my ($msg) = @_;
-
+
my $logfile = "/tmp/rexex_debug.log";
my $logfile = "/tmp/rexex_debug.log";
-
- open my $file, '>>', $logfile or
die
"Unable to open $logfile for writing - $!";
-
+
+ open my $file, '>>', $logfile or
croak
"Unable to open $logfile for writing - $!";
+
print $file "DEBUG: $msg\n";
print $file "DEBUG: $msg\n";
-
- close $file;
\r
+
+ close $file;
+
+ return;
} # _debug
sub ssh {
} # _debug
sub ssh {
@@
-237,7
+239,7
@@
sub ssh {
if ($logged_in) {
# It's always hard to find the prompt. So let's make a distintive one
if ($logged_in) {
# It's always hard to find the prompt. So let's make a distintive one
- $self->{prompt} =
'@@@'
;
+ $self->{prompt} =
"\n@@@"
;
$self->{handle} = $remote;
# OK this is real tricky. If we call execute with a command of PS1=@@@
$self->{handle} = $remote;
# OK this is real tricky. If we call execute with a command of PS1=@@@
@@
-500,6
+502,10
@@
Returns:
# Close any prior opened sessions
$self->logoff if ($self->{handle});
# Close any prior opened sessions
$self->logoff if ($self->{handle});
+ # Check to see if this machines is known in DNS. If not then the chance is
+ # good that we will not be able to log in
+ return unless gethostbyname $self->{host};
+
my $remote;
if ($self->{protocol}) {
my $remote;
if ($self->{protocol}) {
@@
-567,7
+573,7
@@
Returns:
} # logoff
sub new {
} # logoff
sub new {
- my ($class
) = shift
;
+ my ($class
, %parms) = @_
;
=pod
=pod
@@
-632,8
+638,6
@@
Returns:
=cut
=cut
- my %parms = @_;
-
my $self = {};
$self->{host} = $parms{host} ? $parms{host} : 'localhost';
my $self = {};
$self->{host} = $parms{host} ? $parms{host} : 'localhost';