File: reboot.pl

package info (click to toggle)
libnet-openssh-parallel-perl 0.14-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 160 kB
  • sloc: perl: 947; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 415 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl

use strict;
use warnings;

use Net::OpenSSH::Parallel;
use Net::OpenSSH::Parallel::Constants qw(OSSH_ON_ERROR_IGNORE);

my $p = Net::OpenSSH::Parallel->new;

$p->add_host('root@172.26.9.122');

$p->all(cmd => 'echo hello');
$p->all(cmd => { on_error => OSSH_ON_ERROR_IGNORE }, 'reboot');
$p->all(cmd => { reconnections => 500 }, 'echo hello again');

$Net::OpenSSH::Parallel::debug = -1;

$p->run;