diff --git a/shares.py b/shares.py index 4e516735..5b567082 100644 --- a/shares.py +++ b/shares.py @@ -146,11 +146,12 @@ def addShare(baseDir: str, \ # indicate that a new share is available newShareFile=baseDir+'/accounts/.newShare' - try: - with open(newShareFile, 'w') as fp: - fp.write('\n') - except: - pass + if not os.path.isfile(newShareFile): + try: + with open(newShareFile, 'w') as fp: + fp.write('\n') + except: + pass def expireShares(baseDir: str) -> None: """Removes expired items from shares