diff options
| author | josef <josef.gson@gmail.com> | 2015-11-10 09:56:56 +0100 |
|---|---|---|
| committer | josef <josef.gson@gmail.com> | 2015-11-10 09:56:56 +0100 |
| commit | 6885ec5ce5c478cd7e607bbe283554eddb536158 (patch) | |
| tree | 561e17f4971796211b6d34b3984c59f6107b24b0 /monitor/josef_lib.py | |
| parent | ffcd056438f907f27de46129c34026d786129245 (diff) | |
adding issuer monitoring for lets encrypt
Diffstat (limited to 'monitor/josef_lib.py')
| -rw-r--r-- | monitor/josef_lib.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/monitor/josef_lib.py b/monitor/josef_lib.py index f401b2c..46a0eee 100644 --- a/monitor/josef_lib.py +++ b/monitor/josef_lib.py @@ -23,6 +23,28 @@ from Crypto.Hash import SHA256 import Crypto.PublicKey.RSA as RSA from Crypto.Signature import PKCS1_v1_5 + +def prompt_confirm(msg = "", default = True): + print msg + + while True: + if default: + print "Are you sure? (Y/n)" + else: + print "Are you sure? (y/N)" + + import sys + data = sys.stdin.readline() + + if data == "y\n": + return True + elif data == "n\n": + return False + elif data == "\n": + return default + else: + print "Answer either y or n" + def time_str(ts = None): if ts is None: return datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S') |
