| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | decrypt_gpgscip-shell shell shell-project 0.0.0 decrypt_gpg(). () { |
| 4 | echoscip-shell system . . echo. "Performing GPG symmetric decryption ..." >&2 |
| 5 | if ! /lib/cryptsetup/askpassscip-shell filesystem . . `/lib/cryptsetup/askpass`. "Enter passphrase for key $1: " | \ |
| 6 | /usr/bin/gpg -q --batch --no-options \ |
| 7 | --no-random-seed-file --no-default-keyring \ |
| 8 | --keyring /dev/nullscip-shell filesystem . . `/dev/null`. \ |
| 9 | --trustdb-name /dev/nullscip-shell filesystem . . `/dev/null`. --passphrase-fd 0 --decrypt -- "$1"; then |
| 10 | return 1 |
| 11 | fi |
| 12 | return 0 |
| 13 | } |
| 14 | |
| 15 | if [scip-shell system . . `[`. ! -x /usr/bin/gpgscip-shell filesystem . . `/usr/bin/gpg`. ]; then |
| 16 | echoscip-shell system . . echo. "$0: /usr/bin/gpg is not available" >&2 |
| 17 | exit 1 |
| 18 | fi |
| 19 | |
| 20 | if [scip-shell system . . `[`. -z "$1" ]; then |
| 21 | echoscip-shell system . . echo. "$0: missing key as argument" >&2 |
| 22 | exit 1 |
| 23 | fi |
| 24 | |
| 25 | decrypt_gpgscip-shell shell shell-project 0.0.0 decrypt_gpg(). "$1" |
| 26 | exit $? |