summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-fs/cryptsetup/files/1.1.3-dm-crypt-stop.sh')
-rw-r--r--sys-fs/cryptsetup/files/1.1.3-dm-crypt-stop.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/sys-fs/cryptsetup/files/1.1.3-dm-crypt-stop.sh b/sys-fs/cryptsetup/files/1.1.3-dm-crypt-stop.sh
index 138688bced2e..548269c0ae3b 100644
--- a/sys-fs/cryptsetup/files/1.1.3-dm-crypt-stop.sh
+++ b/sys-fs/cryptsetup/files/1.1.3-dm-crypt-stop.sh
@@ -1,15 +1,23 @@
# /lib/rcscripts/addons/dm-crypt-stop.sh
-# Fix for baselayout-1.12.10 (bug 174256)
+# For backwards compatibility with baselayout < 1.13.0 #174256
: ${SVCNAME:=${myservice}}
+# See notes in dm-crypt-start.sh
+execute_hook="dm_crypt_execute_dmcrypt"
+conf_file="dmcrypt"
+case ${SVCNAME} in
+ dmcrypt.*) conf_file="${SVCNAME}" ;;
+esac
+conf_file="/etc/conf.d/${conf_file}"
+
# Try to remove any dm-crypt mappings
csetup=/sbin/cryptsetup
-if [ -f /etc/conf.d/${SVCNAME} ] && [ -x "$csetup" ]
+if [ -f ${conf_file} ] && [ -x "$csetup" ]
then
einfo "Removing dm-crypt mappings"
- /bin/egrep "^(target|swap)" /etc/conf.d/${SVCNAME} | \
+ /bin/egrep "^(target|swap)" ${conf_file} | \
while read targetline
do
target=
@@ -18,16 +26,16 @@ then
eval ${targetline}
[ -n "${swap}" ] && target=${swap}
- [ -z "${target}" ] && ewarn "Invalid line in /etc/conf.d/${SVCNAME}: ${targetline}"
+ [ -z "${target}" ] && ewarn "Invalid line in ${conf_file}: ${targetline}"
ebegin "Removing dm-crypt mapping for: ${target}"
${csetup} remove ${target}
eend $? "Failed to remove dm-crypt mapping for: ${target}"
done
- if [[ -n $(/bin/egrep -e "^(source=)./dev/loop*" /etc/conf.d/${SVCNAME}) ]] ; then
+ if [[ -n $(/bin/egrep -e "^(source=)./dev/loop*" ${conf_file}) ]] ; then
einfo "Taking down any dm-crypt loop devices"
- /bin/egrep -e "^(source)" /etc/conf.d/${SVCNAME} | while read sourceline
+ /bin/egrep -e "^(source)" ${conf_file} | while read sourceline
do
source=
eval ${sourceline}