1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/sogo_ynh.git synced 2024-09-03 20:26:07 +02:00
sogo_ynh/scripts/add_sso_conf.py

17 lines
598 B
Python
Raw Normal View History

#!/usr/bin/python3
import json
with open("/etc/ssowat/conf.json.persistent", "r", encoding='utf-8') as jsonFile:
try:
data = json.load(jsonFile)
except:
print("File /etc/ssowat/conf.json.persistent corrupt, make a new file")
data = {}
if not "skipped_urls" in data:
data["skipped_urls"] = []
data["skipped_urls"] = list(set(data["skipped_urls"]) | set(["/Microsoft-Server-ActiveSync", "/principals"]))
with open("/etc/ssowat/conf.json.persistent", "w", encoding='utf-8') as jsonFile:
jsonFile.write(json.dumps(data, indent=4, sort_keys=True))