Bundle to create bind mounts

This commit is contained in:
Tube 2023-11-14 19:45:58 +01:00
parent a1d3d87602
commit 236965e497
1 changed files with 24 additions and 0 deletions

24
lib.cf
View File

@ -369,3 +369,27 @@ reports:
} }
bundle edit_line bind_mount(src,dst)
{
insert_lines:
freebsd::
"$(src) $(dst) nullfs rw,late 0 0";
centos::
"$(src) $(dst) none defaults,bind 0 0";
}
bundle agent bind_mount(src,dst)
{
files:
"/etc/fstab"
edit_line => bind_mount("$(src)","$(dst)"),
classes => if_repaired(bind_mount_fstab_changed);
commands:
bind_mount_fstab_changed::
"echo '$(src)$(dst)' > /dev/null && mount"
contain=>wmde_cmd_useshell,
args => "-a";
}