share manager

This commit is contained in:
2018-01-26 11:13:44 +02:00
parent 68cf43cc57
commit 6c67f54d8d
3 changed files with 90 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env python
import hashlib,argparse,json,sys
import hashlib,argparse,json,sys,os
from datetime import datetime
from shutil import copyfile
@@ -51,7 +51,10 @@ if opts.expire:
})
if opts.shares:
shares = json.load(open(opts.shares,'rt'))
if os.path.exists(opts.shares):
shares = json.load(open(opts.shares,'rt'))
else:
shares = []
shares.append(share)
if opts.insert:
print("creating backup %s"%(opts.shares+".bkp",))