ref: e5ca8ad10214f721a085416c58288e54204da036
parent: 141ab18dc34b37dd73bfedc34d65dfb468f40ca6
author: qwx <qwx@sciops.net>
date: Thu Sep 30 15:41:54 EDT 2021
tlsupdate: allow use in pipelines
--- a/bin/tlsupdate
+++ b/bin/tlsupdate
@@ -1,8 +1,15 @@
#!/bin/rc
+fn filter {
+ awk '/sha256=.*/ { print "x509", $NF }'
+}
fn update {
echo |\
tlsclient -t /sys/lib/tls/$1 $2 |[2]\
- awk '/sha256=.*/ { print "x509", $NF }' >> /sys/lib/tls/$1
+ filter >> /sys/lib/tls/$1
+}
+if(! ~ $#* 0 && test -f /sys/lib/tls/$1){
+ filter >> /sys/lib/tls/$1
+ exit
}
update mail tcp!imap.gmail.com!imaps
update smtp tcp!smtp.gmail.com!ssmtp