Subversion Repositories sysadmin_scripts

Rev

Rev 117 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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