14 lines
458 B
Python
Executable file
14 lines
458 B
Python
Executable file
#!/usr/bin/python
|
|
import os
|
|
import subprocess
|
|
import requests
|
|
|
|
def retrieve_config():
|
|
my_config = "None"
|
|
my_ip = subprocess.check_output("sleep 5 && echo $MY_IP", shell=True).rstrip()
|
|
resp = requests.get("http://10.10.10.10:5555/getmyconfig/%s"%(my_ip))
|
|
my_config = resp.text
|
|
if my_config != "None":
|
|
subprocess.check_output("node /mydir/*.js %s"%(my_config), shell=True)
|
|
#print("my_ip=%s and of type %s"%(my_ip,type(my_ip)))
|
|
|