Odintsov Pavel > SSH-Command-0.07 > SSH::Command

Download:
SSH-Command-0.07.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.07   Source  

NAME ^

SSH::Command - interface to execute multiple commands on host by SSH protocol without certificates ( only login + password )

SYNOPSIS ^

 use SSH::Command;

 my $result = ssh_execute(
    host     => '127.0.0.1',
    username => 'suxx',
    password => 'qwerty',
    commands =>
        [
            {
                cmd    => 'uname -a', # for check connection
                verify => qr/linux/i, # or  => 'linux-....' (check by 'eq')
            }
        ]
    );

 if ($result) {
    print "all ok!";
 } else {
    print "Command failed!";
 }

  Execute one command and get answer:

  my $command_answer_as_text = ssh_execute(
    host     => '127.0.0.1',
    username => 'suxx',
    password => 'qwerty',
    command  => 'uname',     # for check connection
  );
syntax highlighting: