diff --git a/dockerfile b/dockerfile index 5c1d56c..528f27d 100644 --- a/dockerfile +++ b/dockerfile @@ -1,7 +1,7 @@ -FROM python +FROM debian RUN <<-EOF apt-get update -apt-get install -y python3-cryptography python3-requests python3-toml +apt-get install -y systemd python3 python3-cryptography python3-requests python3-toml EOF ADD scripts\* /airwatchConnector ADD services.py diff --git a/services.py b/services.py index 8fe50d0..038367e 100644 --- a/services.py +++ b/services.py @@ -10,9 +10,9 @@ confFiles = os.listdir(confDir) confFiles = [conf for conf in confFiles if os.path.isfile(f"{confDir}/{conf}") and not conf.endswith(".conf")] for conf in confFiles: - # On forme un nom à partir du nom du fichier de conf sans l'extension - # et on enlève les espaces - confName = conf[:5].replace(' ', '') + # On forme un nom à partir du nom du fichier de conf sans l'extension + # et on enlève les espaces + confName = conf[:5].replace(' ', '') with open(f"{confDir}/{conf}", "r") as f: settings = toml.load(f) @@ -24,8 +24,8 @@ for conf in confFiles: os.makedirs(f"{logDir}/{logPath}") - with open(f"/etc/systemd/system/{confName}-sync.service", "w") as f: - f.write(f"""[Unit] + with open(f"/etc/systemd/system/{confName}-sync.service", "w") as f: + f.write(f"""[Unit] Description=Script Airwatch pour la synchronisation des données Airwatch et GLPI. [Service]