File: gpgv

package info (click to toggle)
nnn 5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,184 kB
  • sloc: ansic: 11,902; sh: 3,585; makefile: 512; cpp: 80; python: 31; csh: 2
file content (28 lines) | stat: -rwxr-xr-x 674 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
#!/usr/bin/env sh

# Description: verifies signed files using gpg.
#              includes options for detached signing
#              (in which case it asks for a document to verify)
#              as well as normal signing
#
# Note: Uses the current file only [selections not supported]
#
# Shell: POSIX compliant
# Author: wassup05

file=$1

printf "(s)ign/(d)etach-sig [default=s] "
read -r sig_resp

if [ "$sig_resp" = "d" ]; then
    printf "Enter document name: "
    read -r doc_name
    command gpg --verify "$file" "$doc_name"
else
    command gpg --verify "$file"
fi

printf "\n"
# shellcheck disable=SC2034
read -r resp     # Waiting for input to go back to nnn