commit c1c5306eb1ab30d619adeedc97506ff352d9ed06 Author: Difrex Date: Mon Aug 1 12:54:48 2016 +0300 Initial 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) +