Fix mhsign for gpg2: Expiry date format
[mmh] / uip / mhsign.sh
index 9d6c747..39a3f69 100755 (executable)
@@ -22,10 +22,11 @@ if [ -z "$userid" ] ; then
        userid="`mhparam pgpkey`"
 fi
 if [ -z "$userid" ] ; then
-       userid="`gpg --list-secret-keys --with-colons 2>/dev/null |
+       userid="`gpg --list-secret-keys --with-colons --fixed-list-mode \
+                               2>/dev/null |
                        grep '^sec' | sort -t: -k3,3nr -k 6,6nr |
                        awk -F: '
-                               $7=="" || $7 > "'"\`date +%Y-%m-%d\`"'" {
+                               $7=="" || $7 > "'"\`date +%s\`"'" {
                                        print $5; exit;
                                }
                        '`"