Subversion Repositories sysadmin_scripts

Rev

Rev 118 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
117 rodolico 1
#! /usr/bin/env perl
2
 
3
use strict;
4
use warnings;
5
use Data::Dumper;
6
 
7
my $virtual = shift;
118 rodolico 8
my %running;
117 rodolico 9
 
10
die `virsh list --inactive` unless $virtual;
11
 
118 rodolico 12
my @temp = `perl findVirtuals.pl -s | grep $virtual`;
117 rodolico 13
chomp @temp;
118 rodolico 14
while ( my $line = shift @temp ) {
15
   my ($key, $value) = split "\t", $line;
16
   $running{$key} = $value;
17
}
117 rodolico 18
 
19
die "$virtual already running on $running{$virtual}\n" if $running{$virtual};
20
 
21
print "I would start $virtual here\n";
118 rodolico 22
print "virsh start $virtual\n";
117 rodolico 23
1;