Initial
This commit is contained in:
commit
c1c5306eb1
1
conf.d/1.json
Normal file
1
conf.d/1.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
4
conf/surok.json
Normal file
4
conf/surok.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"marathon": "10.0.1.199:8080",
|
||||
"confd": "conf.d"
|
||||
}
|
26
surok.py
Executable file
26
surok.py
Executable 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)
|
||||
|
Loading…
Reference in New Issue
Block a user