20 lines
423 B
Python
Executable File
20 lines
423 B
Python
Executable File
#! /usr/bin/env python3
|
|
import json
|
|
import os
|
|
import re
|
|
import glob
|
|
|
|
import sys
|
|
|
|
if __name__ == "__main__":
|
|
data=[]
|
|
filelist = glob.glob( '/etc/letsencrypt/renewal/*.conf' )
|
|
cert=[]
|
|
for line in filelist:
|
|
cert.append( os.path.basename(os.path.splitext(line)[0]) )
|
|
print( os.path.splitext(line)[0] )
|
|
|
|
data = [{"{#CERT}": line.strip()} for line in set(cert)]
|
|
print(json.dumps({"data": data}, indent=4))
|
|
|