[main]
@type = oneshot
@version = @vers@
@description = "Activate encrypted devices"
@user = ( root )
@options = ( !log )
@depends = ( udevadm devices-dmraid devices-lvm )

[start]
@execute =
(
    if { 66-yeller -cdp devices-crypttab -1 /dev/console starts... }
    if -nt {

        execl-toc -e ${script_conf}
        if { execl-cmdline -s { 66-olexec awk -f ${script_file} ${script_conf} } }

        foreground {

            if { 66-which -q vgchange }
            if { 66-yeller -cdp devices-crypttab -1 /dev/console Activating LVM devices for dm-crypt... }
            if -nt {

                vgchange --sysinit -a ay
            }
            66-yeller -cdp devices-crypttab -1 /dev/console unable to activate LVM devices
        }
    }
    66-yeller -fcdp devices-crypttab -1 /dev/console crashed!
)

[environment]
script_file=!/etc/66/script/crypt.awk
script_conf=!/etc/crypttab
