]> git.proxmox.com Git - pve-container.git/blobdiff - src/PVE/LXC/Setup/Base.pm
Add missing '\n' to content in ct_modify_file
[pve-container.git] / src / PVE / LXC / Setup / Base.pm
index e1fd0f3daa8dade2f2b7f9eb19d45f8cc75f671b..eefc506efc2f9e632bf1b5d788140b76686d83b9 100644 (file)
@@ -522,6 +522,7 @@ sub ct_modify_file {
     my $head = "# --- BEGIN PVE ---\n";
     my $tail = "# --- END PVE ---\n";
     my $perms = $options{perms};
+    $data .= "\n" if $data && $data !~ m/.*?\n$/;
 
     if (!$self->ct_file_exists($file)) {
        $self->ct_file_set_contents($file, $head.$data.$tail, $perms) if $data;