File: decrypt_gpg

package info (click to toggle)
cryptsetup 2%3A1.0.4%2Bsvn26-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,572 kB
  • ctags: 418
  • sloc: sh: 10,706; ansic: 3,187; makefile: 329; python: 90; perl: 40; sed: 16
file content (32 lines) | stat: -rw-r--r-- 409 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh

decrypt_gpg () {
	local key tries rc
	key="$1"
	tries=0
	rc=1

	echo "Performing GPG key decryption" >&2
	while [ $tries -lt 3 ]; do
		if /usr/bin/gpg -q --decrypt $key; then
			rc=0
			break
		fi
		tries=$(( tries + 1 ))
	done
	return $rc
}

echo "gpg decryption not implemented yet" >&2
exit 1

if [ ! -x /usr/bin/gpg ]; then
	exit 1
fi

if [ -z "$1" ]; then
	exit 1
fi

decrypt_gpg "$1"
exit $?