From c1c5306eb1ab30d619adeedc97506ff352d9ed06 Mon Sep 17 00:00:00 2001 From: Difrex Date: Mon, 1 Aug 2016 12:54:48 +0300 Subject: [PATCH] Initial --- conf.d/1.json | 1 + conf/surok.json | 4 ++++ surok.py | 26 ++++++++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 conf.d/1.json create mode 100644 conf/surok.json create mode 100755 surok.py diff --git a/conf.d/1.json b/conf.d/1.json new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/conf.d/1.json @@ -0,0 +1 @@ +{} diff --git a/conf/surok.json b/conf/surok.json new file mode 100644 index 0000000..96046a7 --- /dev/null +++ b/conf/surok.json @@ -0,0 +1,4 @@ +{ + "marathon": "10.0.1.199:8080", + "confd": "conf.d" +} diff --git a/surok.py b/surok.py new file mode 100755 index 0000000..626343e --- /dev/null +++ b/surok.py @@ -0,0 +1,26 @@ +#!/usr/bin/python3 + +from time import sleep +from os import listdir +from os.path import isfile, join +import json + +# Load base configurations +f = open('conf/surok.json', 'r') +conf = json.loads(f.read()) +print(conf) + + +# Get app configurations +def get_configs(): + confs = [f for f in listdir(conf['confd']) if isfile(join(conf['confd'], f))] + return confs + + +# Main loop +while 1: + confs = get_configs() + for i in confs: + print(i) + sleep(5) +