From: Wolfgang Bumiller Date: Mon, 31 Aug 2015 14:21:41 +0000 (+0200) Subject: skip lxc hooks on non-PVE containers X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=4ed2b8259d69c2e58b618b2512d20a5a7adeeee6;p=pve-container.git skip lxc hooks on non-PVE containers 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. --- diff --git a/src/lxc-pve-mount-hook b/src/lxc-pve-mount-hook index eb80c9e..5ca33ee 100755 --- a/src/lxc-pve-mount-hook +++ b/src/lxc-pve-mount-hook @@ -2,6 +2,9 @@ use strict; use warnings; + +exit 0 if $ENV{'LXC_NAME'} !~ /^\d+$/; + use POSIX; use File::Path; diff --git a/src/lxc-pve-poststop-hook b/src/lxc-pve-poststop-hook index 407d659..17463e8 100755 --- a/src/lxc-pve-poststop-hook +++ b/src/lxc-pve-poststop-hook @@ -2,6 +2,9 @@ use strict; use warnings; + +exit 0 if $ENV{'LXC_NAME'} !~ /^\d+$/; + use POSIX; use File::Path; diff --git a/src/lxc-pve-prestart-hook b/src/lxc-pve-prestart-hook index 764cd2b..4de47c9 100755 --- a/src/lxc-pve-prestart-hook +++ b/src/lxc-pve-prestart-hook @@ -2,6 +2,9 @@ use strict; use warnings; + +exit 0 if $ENV{'LXC_NAME'} !~ /^\d+$/; + use POSIX; use File::Path; diff --git a/src/lxcnetaddbr b/src/lxcnetaddbr index bb8d726..aca6191 100755 --- a/src/lxcnetaddbr +++ b/src/lxcnetaddbr @@ -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;