aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrc.shutdown18
-rwxr-xr-xrc.sysinit2
2 files changed, 10 insertions, 10 deletions
diff --git a/rc.shutdown b/rc.shutdown
index 8a63966..0acca49 100755
--- a/rc.shutdown
+++ b/rc.shutdown
@@ -72,17 +72,17 @@ stat_busy "Unmounting Filesystems"
stat_done
# Kill non-root encrypted partition mappings
-if [[ -f /etc/crypttab && $CS ]]; then
+if [[ -f /etc/crypttab && -n $CS ]] && /bin/grep -q ^[^#] /etc/crypttab; then
stat_busy "Deactivating encrypted volumes:"
do_lock() {
- stat_append "${1}.."
- if $CS remove "$1" >/dev/null 2>&1; then
- stat_append "ok "
- else
- stat_append "failed "
- fi
- }
- read_crypttab do_lock
+ stat_append "${1}.."
+ if $CS remove "$1" >/dev/null 2>&1; then
+ stat_append "ok "
+ else
+ stat_append "failed "
+ fi
+ }
+ read_crypttab do_lock
stat_done
fi
diff --git a/rc.sysinit b/rc.sysinit
index 4080a0d..d15e1be 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -120,7 +120,7 @@ fi
activate_vgs
# Set up non-root encrypted partition mappings
-if [[ -f /etc/crypttab && $CS && -n $(/bin/grep -v ^# /etc/crypttab | /bin/grep -v ^$) ]]; then
+if [[ -f /etc/crypttab && -n $CS ]] && /bin/grep -q ^[^#] /etc/crypttab; then
/sbin/modprobe -q dm-crypt 2>/dev/null
stat_busy "Unlocking encrypted volumes:"
do_unlock() {