3 # Based on apt-key from apt-0.6.25
4 # Licensed under GPL Version 2
9 echo "Usage: opkg-key [options] command [arguments]"
11 echo "Manage opkg's list of trusted keys"
13 echo " opkg-key add <file> - add the key contained in <file> ('-' for stdin)"
14 echo " opkg-key del <keyid> - remove the key <keyid>"
15 echo " opkg-key list - list keys"
18 echo " -o <root> Use <root> as the offline root directory"
22 if [ "$1" = "-o" ]; then
25 echo "Note: using \"$ROOT\" as root path"
31 if [ -z "$command" ]; then
37 if [ "$command" != "help" ] && ! which gpg >/dev/null 2>&1; then
38 echo >&2 "Warning: gnupg does not seem to be installed."
39 echo >&2 "Warning: opkg-key requires gnupg for most operations."
43 # We don't use a secret keyring, of course, but gpg panics and
44 # implodes if there isn't one available
46 GPG="gpg --no-options --no-default-keyring --keyring $ROOT/etc/opkg/trusted.gpg --secret-keyring $ROOT/etc/opkg/secring.gpg --trustdb-name $ROOT/etc/opkg/trustdb.gpg"
50 $GPG --quiet --batch --import "$1"
54 $GPG --quiet --batch --delete-key --yes "$1"
58 $GPG --batch --list-keys
61 $GPG --batch --fingerprint
64 echo "Executing: $GPG $*"