]> git.proxmox.com Git - pve-installer.git/commitdiff
pbs: write out email to user.cfg
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 8 Nov 2020 17:31:54 +0000 (18:31 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 8 Nov 2020 17:44:05 +0000 (18:44 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
proxinstall

index 481fb13971533cc14acd8b28044bbfb54784c949..9137e956425722eef4be3b71b5e4566bb8b655bd 100755 (executable)
@@ -1852,8 +1852,7 @@ _EOD
                         "$tmpdir/datacenter.cfg");
 
            # save admin email
-           write_config("user:root\@pam:1:0:::${mailto}::\n",
-                        "$tmpdir/user.cfg");
+           write_config("user:root\@pam:1:0:::${mailto}::\n", "$tmpdir/user.cfg");
 
            # write storage.cfg
            my $storage_cfg_fn = "$tmpdir/storage.cfg";
@@ -1872,11 +1871,15 @@ _EOD
            syscmd("rm -rf $tmpdir");
        } elsif ($setup->{product} eq 'pbs') {
            my $base_cfg_path = "/etc/proxmox-backup";
-           my $target_cfg_path = "$targetdir/$base_cfg_path";
-           mkdir $target_cfg_path;
+           mkdir "$targetdir/$base_cfg_path";
 
            chroot_chown($targetdir, $base_cfg_path, user => 'backup', recursive => 1);
            chroot_chmod($targetdir, $base_cfg_path, mode => '0700');
+
+           my $user_cfg_fn = "$base_cfg_path/user.cfg";
+           write_config("user: root\@pam\n\temail ${mailto}\n", "$targetdir/$user_cfg_fn");
+           chroot_chown($targetdir, $user_cfg_fn, user => 'root', group => 'backup');
+           chroot_chmod($targetdir, $user_cfg_fn, mode => '0640');
        }
     };