Debian Codegraph @

debian/scripts/cryptdisks_stop

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/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 from cryptdisks_start by Jon Dowland <[email protected]>
7 # Copyright (C) 2008 by Jonas Meurer <[email protected]>
8 # License: GNU General Public License, v2 or any later
9 # (https://www.gnu.org/copyleft/gpl.html)
10
11 set -e
12
13 if [scip-shell system . . `[`. $# -lt 1 ]; then
14 echoscip-shell system . . echo. "usage: $0 <name>" >&2
15 echoscip-shell system . . echo. >&2
16 echoscip-shell system . . echo. "reads /etc/crypttab and stops the mapping corresponding to <name>" >&2
17 exit 1
18 fi
19
20 . /lib/cryptsetup/cryptdisks-functionsscip-shell source . . `/lib/cryptsetup/cryptdisks-functions`.
21
22 INITSTATE="manual"
23 DEFAULT_LOUD="yes"
24
25 if [scip-shell system . . `[`. $(idscip-shell system . . id. -u) -ne 0 ]; then
26 log_warning_msg "$0 needs root privileges"
27 exit 1
28 fi
29
30 log_action_begin_msg "Stopping crypto disk"
31
32 rv=0
33 for name in "$@"; do
34 remove_mapping "$name" || rv=$?
35 done
36
37 log_action_end_msg $rv
38 exit $rv