]> git.proxmox.com Git - pve-container.git/commitdiff
skip lxc hooks on non-PVE containers
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 31 Aug 2015 14:21:41 +0000 (16:21 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 1 Sep 2015 05:48:34 +0000 (07:48 +0200)
Our containers all only have a number as name. If any other
character appears in a container name, skip our hooks in
order to allow lxc to be used manually without interference
from PVE.

src/lxc-pve-mount-hook
src/lxc-pve-poststop-hook
src/lxc-pve-prestart-hook
src/lxcnetaddbr

index eb80c9e53889cadc2ae7016ee3dd2b6e2b7421cb..5ca33ee42bc2a2f9adc3b179209a0a6741a160b2 100755 (executable)
@@ -2,6 +2,9 @@
 
 use strict;
 use warnings;
+
+exit 0 if $ENV{'LXC_NAME'} !~ /^\d+$/;
+
 use POSIX;
 use File::Path;
 
index 407d65956aa9fdf2580e98bc03ff9f6b161764c7..17463e881ffa10e9818f925d121aababc7d3473f 100755 (executable)
@@ -2,6 +2,9 @@
 
 use strict;
 use warnings;
+
+exit 0 if $ENV{'LXC_NAME'} !~ /^\d+$/;
+
 use POSIX;
 use File::Path;
 
index 764cd2bf0d3832fd2569cfec8eb976461d345d92..4de47c9858f417aa143f8b58a32bc62994a92da8 100755 (executable)
@@ -2,6 +2,9 @@
 
 use strict;
 use warnings;
+
+exit 0 if $ENV{'LXC_NAME'} !~ /^\d+$/;
+
 use POSIX;
 use File::Path;
 
index bb8d7263dcc682ce24d5021c80734b774ebfad08..aca61918ba086aa4874bcc68cd35a6d31d1e58da 100755 (executable)
@@ -3,6 +3,8 @@
 use strict;
 use warnings;
 
+exit 0 if $ENV{LXC_NAME} !~ /^\d+$/;
+
 use PVE::LXC;
 use PVE::Tools qw(run_command);
 use PVE::Network;