Created
January 4, 2017 01:39
-
-
Save Jmainguy/bb485bd58b9b83f4b09f69a982eb1072 to your computer and use it in GitHub Desktop.
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
def bash(cmd): | |
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
stdout, stderr = p.communicate() | |
rc = p.wait() | |
return stdout, stderr, rc | |
# Run check_ssl.py | |
cmd = '/etc/ssl/private/letsencrypt/check_ssl.py %s' % domain | |
stdout, stderr, rc = bash(cmd) | |
if rc == 2: | |
print stdout | |
sys.exit(1) | |
elif rc == 0: | |
print stdout | |
print "Cert does not need an udate" | |
sys.exit(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment