mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
net/wireguard: rearrange post-start duties #3206
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
PLUGIN_NAME= wireguard
|
||||
PLUGIN_VERSION= 1.13
|
||||
PLUGIN_REVISION= 2
|
||||
PLUGIN_REVISION= 3
|
||||
PLUGIN_COMMENT= WireGuard VPN service
|
||||
PLUGIN_DEPENDS= wireguard-tools
|
||||
PLUGIN_MAINTAINER= m.muenz@gmail.com
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
# start again to fix problems with failed name resolution (no need to restart)
|
||||
/usr/local/etc/rc.d/wireguard start
|
||||
|
||||
# reconfigure routing for wireguard
|
||||
/usr/local/etc/rc.routing_configure
|
||||
configctl -dq wireguard start
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -f /etc/rc.conf.d/wireguard ]; then
|
||||
. /etc/rc.conf.d/wireguard
|
||||
fi
|
||||
|
||||
for interface in ${wireguard_interfaces}; do
|
||||
ifconfig ${interface} group wireguard
|
||||
done
|
||||
|
||||
/usr/local/etc/rc.routing_configure
|
||||
@@ -1,5 +1,5 @@
|
||||
[start]
|
||||
command:/usr/local/etc/rc.d/wireguard start; /usr/local/etc/rc.routing_configure
|
||||
command:/usr/local/etc/rc.d/wireguard start; /usr/local/opnsense/scripts/OPNsense/Wireguard/post.sh
|
||||
parameters:
|
||||
type:script
|
||||
message:Starting WireGuard
|
||||
@@ -11,7 +11,7 @@ type:script
|
||||
message:Stopping WireGuard
|
||||
|
||||
[restart]
|
||||
command:/usr/local/etc/rc.d/wireguard restart; /usr/local/etc/rc.routing_configure
|
||||
command:/usr/local/etc/rc.d/wireguard restart; /usr/local/opnsense/scripts/OPNsense/Wireguard/post.sh
|
||||
parameters:
|
||||
type:script
|
||||
message:Restarting WireGuard
|
||||
|
||||
@@ -10,13 +10,6 @@ wireguard_enable="YES"
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
wireguard_interfaces="{{ activeservers | join(' ') }}"
|
||||
start_postcmd=opnsense_postcmd
|
||||
opnsense_postcmd()
|
||||
{
|
||||
for interface in ${wireguard_interfaces}; do
|
||||
ifconfig ${interface} group wireguard
|
||||
done
|
||||
}
|
||||
{% else %}
|
||||
wireguard_enable="NO"
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user