/[vz-tools]/trunk/vz-remove.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/vz-remove.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 40 by dpavlin, Fri Feb 8 23:02:25 2008 UTC revision 43 by dpavlin, Fri Feb 8 23:53:52 2008 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -w  #!/usr/bin/perl -w
2    
3  use strict;  use strict;
4  use Shell qw/rm vzlist vzctl/;  use Shell qw/rm/;
5    
6  use lib 'lib';  use lib 'lib';
7  use VZ;  use VZ;
# Line 9  check_root; Line 9  check_root;
9    
10  my $VEID = shift @ARGV;  my $VEID = shift @ARGV;
11    
12  die "Usage: $0 VEID\n\n", join("\n",vzlist_configs()),"\n" unless $VEID;  die "Usage: $0 VEID\n\n", join("\n",conf_veids()),"\n" unless $VEID;
13    
14  my $c = "$vz_conf/$VEID.conf";  my $c = "$vz_conf/$VEID.conf";
15  if ( -e $c ) {  if ( -e $c ) {
16          vzctl('stop', $VEID);          vzctl('stop', $VEID) if defined( vzlist( hash => 1 )->{ $VEID } );
17          unlink $c || die "can't remove $c: $!";          unlink $c || die "can't remove $c: $!";
18          warn "# removed $c\n";          warn "# removed $c\n";
19  } else {  } else {

Legend:
Removed from v.40  
changed lines
  Added in v.43

  ViewVC Help
Powered by ViewVC 1.1.26