Changeset View
Changeset View
Standalone View
Standalone View
share/pgpkeys/checkkey.sh
Show First 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | |||||
# onto the argument list for later processing (becasue we may have | # onto the argument list for later processing (becasue we may have | ||||
# been given a list of keyods). | # been given a list of keyods). | ||||
if echo "${id}" | egrep -q '^[0-9A-F]{16}$'; then | if echo "${id}" | egrep -q '^[0-9A-F]{16}$'; then | ||||
id_type="keyid" | id_type="keyid" | ||||
set -- "${id}" $@ | set -- "${id}" $@ | ||||
elif echo "${id}" | egrep -q '^[0-9A-F]{8}$'; then | elif echo "${id}" | egrep -q '^[0-9A-F]{8}$'; then | ||||
id_type="keyid" | id_type="keyid" | ||||
set -- "${id}" $@ | set -- "${id}" $@ | ||||
elif echo "${id}" | egrep -iq '^[a-z][-0-9a-z_]*@([-0-9a-z]+\.)[-0-9a-z]+$'; then | elif echo "${id}" | egrep -iq '^[0-9a-z][-0-9a-z_]*@([-0-9a-z]+\.)[-0-9a-z]+$'; then | ||||
id_type="email" | id_type="email" | ||||
email="${id}" | email="${id}" | ||||
elif echo "${id}" | egrep -iq '^[a-z][-0-9a-z_]*$'; then | elif echo "${id}" | egrep -iq '^[0-9a-z][-0-9a-z_]*$'; then | ||||
id_type="login" | id_type="login" | ||||
login="${id}" | login="${id}" | ||||
email="${id}@FreeBSD.org" | email="${id}@FreeBSD.org" | ||||
else | else | ||||
error "Cannot recognize type of ${id} (keyid, login, or email)" | error "Cannot recognize type of ${id} (keyid, login, or email)" | ||||
fi | fi | ||||
if [ $# -ne 0 ] ; then | if [ $# -ne 0 ] ; then | ||||
▲ Show 20 Lines • Show All 162 Lines • Show Last 20 Lines |