~siretart/cryptsetup/debian

« back to all changes in this revision

Viewing changes to debian/scripts/cryptdisks_stop

  • Committer: Reinhard Tartler
  • Date: 2008-05-25 20:03:28 UTC
  • Revision ID: siretart@tauware.de-20080525200328-szhw0j5yw0p5kl33
import cryptsetup_1.0.6~pre1+svn45-1.dsc

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# cryptdisks_stop - wrapper around cryptsetup which parses
 
4
# /etc/crypttab, just like mount parses /etc/fstab.
 
5
 
 
6
# Initial code stolen by Jonas Meurer <jonas@freesources.org> from
 
7
# cryptdisks_start by Jon Dowland <jon@alcopop.org>
 
8
# License: GNU General Public License, v2 or any later
 
9
# (http://www.gnu.org/copyleft/gpl.html)
 
10
 
 
11
set -e
 
12
 
 
13
if [ $# -lt 1 ]; then
 
14
        echo "usage: $0 <name>" >&2
 
15
        echo >&2
 
16
        echo "reads /etc/crypttab and stops the mapping corresponding to <name>" >&2
 
17
        exit 1
 
18
fi
 
19
 
 
20
if [ -r /lib/cryptsetup/cryptdisks.functions ]; then
 
21
        . /lib/cryptsetup/cryptdisks.functions
 
22
else
 
23
        exit 0
 
24
fi
 
25
 
 
26
egrep -v "^[[:space:]]*(#|$)" "$TABFILE" | while read dst src key opts; do
 
27
        if [ "$1" = "$dst" ]; then
 
28
                handle_crypttab_line_stop "$dst" "$src" "$key" "$opts"
 
29
                exit 0
 
30
        fi
 
31
done