|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/21585/root/usr/lib/hal/scripts/linux/ |
Upload File : |
#!/bin/bash
# Copyright (C) 2005 W. Michael Petullo <mike@flyn.org>
# Copyright (C) 2006 David Zeuthen <davidz@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2.
CRYPTSETUP=/sbin/cryptsetup
echo LUKS cryptotext device $HAL_PROP_INFO_UDI is going away
# make sure that the cleartext volume is unmounted
CLEARTEXT_VOLUME_UDI=`hal-find-by-property --key volume.crypto_luks.clear.backing_volume --string $HAL_PROP_INFO_UDI`
RET=$?
if [ x$RET = x0 ]; then
echo Attempting unmount of corresponding LUKS cleartext volume $CLEARTEXT_VOLUME_UDI
# lazy unmount via D-BUS
dbus-send --print-reply --system \
--dest=org.freedesktop.Hal \
$CLEARTEXT_VOLUME_UDI \
org.freedesktop.Hal.Device.Volume.Unmount \
array:string:lazy
fi
echo Tearing down LUKS cryptotext volume
if [ ! -f $CRYPTSETUP ]; then
echo Error removing $HAL_PROP_BLOCK_DEVICE - $CRYPTSETUP not found >&2
exit 1
fi
if [ -z $HAL_PROP_VOLUME_UUID ]; then
echo Error determining UUID of $HAL_PROP_BLOCK_DEVICE >&2
exit 1
fi
if ! $CRYPTSETUP luksClose luks_crypto_$HAL_PROP_VOLUME_UUID 2> /dev/null; then
echo Error removing luks_crypto_$HAL_PROP_VOLUME_UUID >&2
exit 1
fi
exit 0