renaming m-h update_gpg_pub_file to update_pgp_pub_file
[monkeysphere.git] / src / monkeysphere-host
index a580ef2b9ffc391e4a06c8b47421b009e09c4798..2335f1a0f2a8ed350af4ad6af78ec3bcf7ccda39 100755 (executable)
@@ -34,7 +34,7 @@ MHSHAREDIR="${SYSSHAREDIR}/mh"
 MHDATADIR="${SYSDATADIR}/host"
 
 # host pub key files
-HOST_KEY_FILE="${SYSDATADIR}/host_keys.pub.gpg"
+HOST_KEY_FILE="${SYSDATADIR}/host_keys.pub.pgp"
 
 # UTC date in ISO 8601 format if needed
 DATE=$(date -u '+%FT%T')
@@ -89,13 +89,12 @@ gpg_host_edit() {
     gpg_host --command-fd 0 --edit-key "$@"
 }
 
-# export the monkeysphere gpg pub key file
-update_gpg_pub_file() {
+# export the monkeysphere OpenPGP pub key file
+update_pgp_pub_file() {
     log debug "updating openpgp public key file '$HOST_KEY_FILE'..."
-    gpg_host --export --armor --export-options export-minimal > "$HOST_KEY_FILE"
-    log debug "updating fingerprint file '$HOST_KEY_FPR_FILE'..."
-    gpg_host --list-secret-key --with-colons --with-fingerprint \
-       | awk -F: '/^fpr:/{ print $10 }' > "$HOST_KEY_FPR_FILE"
+    gpg_host --export --armor --export-options export-minimal \
+        $(gpg_host --list-secret-keys --with-colons --fingerprint | grep ^fpr | cut -f9 -d:) \
+        > "$HOST_KEY_FILE"
 }
 
 host_fingerprints() {
@@ -332,8 +331,8 @@ case $COMMAND in
        diagnostics
        ;;
 
-    'update-gpg-pub-file')
-       update_gpg_pub_file
+    'update-pgp-pub-file')
+       update_pgp_pub_file
        ;;
 
     'version'|'v')