summaryrefslogtreecommitdiff
path: root/rc.shutdown
diff options
context:
space:
mode:
authorSolstice d'Hiver <solstice.dhiver@gmail.com>2009-12-05 16:51:16 +0200
committerRoman Kyrylych <roman@archlinux.org>2009-12-05 16:51:16 +0200
commitd7622e0cedbcfd6bda7ac0b8354c6fea5d127f37 (patch)
tree2195cffcc6bf9865fe938620bb98174f6ef61329 /rc.shutdown
parentbdf8fdb363c9e38bfaad927caac0fecbe989df6b (diff)
Check that cryptsetup mapping exists before trying to remove it
Signed-off-by: Roman Kyrylych <roman@archlinux.org>
Diffstat (limited to 'rc.shutdown')
-rwxr-xr-xrc.shutdown14
1 files changed, 8 insertions, 6 deletions
diff --git a/rc.shutdown b/rc.shutdown
index 623146e..b0de393 100755
--- a/rc.shutdown
+++ b/rc.shutdown
@@ -109,12 +109,14 @@ if [ -f /etc/crypttab -a -n "$(/bin/grep -v ^# /etc/crypttab | /bin/grep -v ^$)"
CS=/sbin/cryptsetup.static
do_uncrypt() {
if [ $# -ge 3 ]; then
- stat_append "${1}.."
- $CS remove $1 >/dev/null 2>&1
- if [ $? -ne 0 ]; then
- stat_append "failed "
- else
- stat_append "ok "
+ if [ -b /dev/mapper/$1 ] ;then
+ stat_append "${1}.."
+ $CS remove $1 >/dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ stat_append "failed "
+ else
+ stat_append "ok "
+ fi
fi
fi
}