diff options
Diffstat (limited to 'openswap.hook')
-rw-r--r-- | openswap.hook | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/openswap.hook b/openswap.hook new file mode 100644 index 000000000000..24331482913f --- /dev/null +++ b/openswap.hook @@ -0,0 +1,17 @@ +run_hook () +{ + ## read openswap configurations + source openswap.conf + + if [ -z "$keyfile_device" ] || [ -z "$keyfile_filename" ] + then + ## case when no keyfile provided in configurations + cryptsetup open "$swap_device" "$crypt_swap_name" + else + ## case when keyfile is provided in configurations + mkdir openswap_keymount + mount "$keyfile_device" openswap_keymount + cryptsetup open $miscellaneous --key-file "openswap_keymount/$keyfile_filename" "$swap_device" "$crypt_swap_name" + umount openswap_keymount + fi +}
\ No newline at end of file |