This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
hostname=$1 | |
expire_str=$(true | openssl s_client -connect $hostname:443 2>/dev/null | openssl x509 -noout -enddate | cut -d = -f2) | |
expire=$(date -d "$expire_str" +%s) | |
current=$(date +%s) | |
secs_left=$(expr $expire - $current) | |
days_left=$(expr $secs_left / 3600 / 24) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// public/cliserver.php (router script) | |
if (php_sapi_name() !== 'cli-server') { | |
die('this is only for the php development server'); | |
} | |
if (is_file($_SERVER['DOCUMENT_ROOT'].'/'.$_SERVER['SCRIPT_NAME'])) { | |
// probably a static file... | |
return false; |