Since the I/O Juggler will no longer work in the future, I wanted to use the Event Juggler.
However, I have not been able to find a way to deactivate or activate Wireguard via a script.
Can anyone help me with this? The Wireguard connection should be switched on and off via a key switch using input (3).
It used to be very easy. I used to disable my Wireguard connections with this command, but now nothing seems to work in the new Event Juggler.
I can’t even tell if the script is starting or what is happening in the background. I can’t find any status messages or reports.
Example:
uci set network.NameofWireguardconnectgion1.disabled=‘1’
uci set network.NameofWireguardconnectgion2.disabled=‘1’
uci set network.NameofWireguardconnectgion3.disabled=‘1’
uci set network.NameofWireguardconnectgion4.disabled=‘1’
uci commit network
/etc/init.d/network restart
I have configured everything, but it does not start the script.
Where can I see what the problem is?
It goes through the condition, but is it actually running my script?
How can I tell if it has accepted and processed the script?
Hello Marija,
Yes, I found a solution using the UCI commands. However, I have to restart the modem every time, which is not very convenient.
I haven’t implemented your suggestion with the Wireguard POST script. Could you send me an example?
Can I stop Wireguard without having to restart the modem every time? If I use the key switch?
When using the API, there is no need to restart the network — you can simply enable or disable the WireGuard instance.
To disable WireGuard: api put /wireguard/config '{"data":[{"id":"tunnelname","enabled":"0"}]}'
To enable WireGuard: api put /wireguard/config '{"data":[{"id":"tunnelname","enabled":"1"}]}'.
Oh, now I understand… This would be a completely different implementation than the one I implemented above. I thought everything was done via the WEB GUI? The API is a completely different approach.
The Wireguard configuration would therefore not be created via the WEB GUI, but via a script in JSON format.
Can you provide me with a backup of a sample configuration? So I can see how the API is used.
If you have WireGuard configured on your router, you can log in via CLI and execute the command: api get /wireguard/config
This will return your WireGuard configuration so you can review its structure.