From a4970d0be9239929ab8b95193b1426b8389f5524 Mon Sep 17 00:00:00 2001 From: Andrew Sichevoi Date: Tue, 1 May 2012 15:30:44 +0400 Subject: [PATCH] TrueCrypt volumes unmount script on hibernate/sleep added --- etc.default.truecrypt | 5 +++ ...pm.sleep-d.20_unmount-truecrypt-containers | 31 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100755 etc.pm.sleep-d.20_unmount-truecrypt-containers diff --git a/etc.default.truecrypt b/etc.default.truecrypt index bb56fe8..3ff9771 100644 --- a/etc.default.truecrypt +++ b/etc.default.truecrypt @@ -11,6 +11,11 @@ ### default : /usr/bin/truecrypt TRUECRYPT_BINARY=/usr/bin/truecrypt +### application: pm-utils +### description: specifies whether should *all* mounted TC volumes unmounted +### on sleep/hibernate or not +UNMOUNT_ON_SLEEP=true + ### application: truecrypt-mount ### description: specifies user's root directory where all TC's volumes to are mounted in ### %username% is substituted with a name of the user diff --git a/etc.pm.sleep-d.20_unmount-truecrypt-containers b/etc.pm.sleep-d.20_unmount-truecrypt-containers new file mode 100755 index 0000000..d5995e6 --- /dev/null +++ b/etc.pm.sleep-d.20_unmount-truecrypt-containers @@ -0,0 +1,31 @@ +#! /bin/sh + +### TrueCrypt PM Sleep Unmounter +### This file is a part of `truecrypt-extra` +### +### (c) Andrew Sichevoi, http://thekondor.net +### Distributed in the terms of GNU GPL v3.0+ license +### +### The latest version is available on http://git.thekondor.net + +if [ -f /etc/default/truecrypt ]; then + . /etc/default/truecrypt +fi + +unmount_all_truecrypt_volumes () +{ + ${TRUECRYPT_BINARY} -d +} + +case $1 in + suspend|suspend_hybrid|hibernate) + if "${UNMOUNT_ON_SLEEP}"; then + unmount_all_truecrypt_volumes + fi + ;; + resume|thaw) + ### There is no need to do anything here + : + ;; +esac + -- 2.20.1