From ee3385a97bef10fc20ed8c04e1b0dee0d5f0194c Mon Sep 17 00:00:00 2001 From: Seblu Date: Fri, 11 Feb 2011 01:48:03 +0100 Subject: Improve encrypted filesystem detection --- rc.shutdown | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'rc.shutdown') 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 -- cgit v1.2.3