|
|
|
@ -59,16 +59,6 @@ def _update_job(core_config, plugin_config):
|
|
|
|
except requests.exceptions.ConnectionError:
|
|
|
|
except requests.exceptions.ConnectionError:
|
|
|
|
raise
|
|
|
|
raise
|
|
|
|
|
|
|
|
|
|
|
|
def generate_new_zerotier_id():
|
|
|
|
|
|
|
|
print("Removing old Zerotier id files")
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
os.remove("/var/lib/zerotier-one/identity.public")
|
|
|
|
|
|
|
|
os.remove("/var/lib/zerotier-one/identity.secret")
|
|
|
|
|
|
|
|
except:
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
print("Restarting Zerotier systemd service to regenerate ID")
|
|
|
|
|
|
|
|
subprocess.run(["systemctl", "restart", "zerotier-one.service"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def generate_new_id(root_dir):
|
|
|
|
def generate_new_id(root_dir):
|
|
|
|
global client_id
|
|
|
|
global client_id
|
|
|
|
with open(os.path.join(root_dir, "shepherd.id"), 'w+') as f:
|
|
|
|
with open(os.path.join(root_dir, "shepherd.id"), 'w+') as f:
|
|
|
|
@ -77,6 +67,9 @@ def generate_new_id(root_dir):
|
|
|
|
f.write(client_id)
|
|
|
|
f.write(client_id)
|
|
|
|
generate_new_zerotier_id()
|
|
|
|
generate_new_zerotier_id()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_config(config_dir):
|
|
|
|
|
|
|
|
return {}
|
|
|
|
|
|
|
|
|
|
|
|
def init_control(core_config, plugin_config):
|
|
|
|
def init_control(core_config, plugin_config):
|
|
|
|
global client_id
|
|
|
|
global client_id
|
|
|
|
global control_url
|
|
|
|
global control_url
|
|
|
|
|