Skip to content

Instantly share code, notes, and snippets.

<?php
/**
*
* This script extracts the most recent packages updates from a debian server
* by parsing the /var/log/apt/history.log file.
* It creates a new log file whose location can be provided as a shell parameter
*
*/
#### ####
#!/bin/sh
# Released under CC0 licence cf. http://creativecommons.org/publicdomain/zero/1.0/
HOST="$1"
echo "POP3 + TLS (110)"
openssl s_client -CAfile /etc/ssl/certs/ca-certificates.crt -host "${HOST}" -port 110 -starttls pop3 2>&1 </dev/null | egrep "(^subject=|Verify return code)"
echo "POP3 + SSL (995)"
openssl s_client -CAfile /etc/ssl/certs/ca-certificates.crt -host "${HOST}" -port 995 2>&1 </dev/null | egrep "(^subject=|Verify return code)"