This commit is contained in:
Difrex 2016-08-01 12:54:48 +03:00
commit c1c5306eb1
3 changed files with 31 additions and 0 deletions

1
conf.d/1.json Normal file
View File

@ -0,0 +1 @@
{}

4
conf/surok.json Normal file
View File

@ -0,0 +1,4 @@
{
"marathon": "10.0.1.199:8080",
"confd": "conf.d"
}

26
surok.py Executable file
View File

@ -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)