Logic Machine Forum
Zerotier enable disable via script - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Zerotier enable disable via script (/showthread.php?tid=5840)



Zerotier enable disable via script - savaskorkmaz - 14.01.2025

Hi,
Can we enable / disable , server status of Zerotier via script ? 
We would like to add a button in visu for our customer who will give us permission for zerotier.

Thx


RE: Zerotier enable disable via script - Daniel - 14.01.2025

Like this
Code:
enabled = event.getvalue()

require('uci')
uci.set('zerotier', 'default', 'enabled', enabled and 1 or 0)
uci.commit('zerotier')

os.execute('/etc/init.d/zerotier restart')



RE: Zerotier enable disable via script - savaskorkmaz - 14.01.2025

(Yesterday, 10:38)Daniel Wrote: Like this
Code:
enabled = event.getvalue()

require('uci')
uci.set('zerotier', 'default', 'enabled', enabled and 1 or 0)
uci.commit('zerotier')

os.execute('/etc/init.d/zerotier restart')

Hi, what about for disabling ?


RE: Zerotier enable disable via script - Daniel - 14.01.2025

Just try it with a bit object and event script.