WireGuard: delayed service update to avoid race condition

This commit is contained in:
bergware
2023-06-23 23:51:34 +02:00
parent 1c7c315dcd
commit d2dc649f8b
3 changed files with 10 additions and 2 deletions

View File

@@ -130,7 +130,7 @@ $active = explode(' ',exec('wg show interfaces'));
$autostart = explode(' ',@file_get_contents("$etc/autostart")?:'');
$build = false;
$script = "$docroot/webGui/scripts/upnp_port";
$services = "$docroot/webGui/scripts/reload_services";
$services = "$docroot/webGui/scripts/update_services";
$template = "$docroot/webGui/WGX.page";
$tower = _var($var,'NAME');
$ethX = 'eth0';

View File

@@ -1,5 +1,5 @@
#!/bin/bash
SERVICES="sshd avahidaemon samba rpc nfsd ntpd nginx"
SERVICES="rpc nfsd ntpd nginx sshd avahidaemon samba"
if [[ -n $1 ]]; then
[[ ! -e $1 ]] && touch $1 || exit 0

View File

@@ -0,0 +1,8 @@
#!/bin/bash
job=/tmp/wgjob.tmp
reload=/usr/local/emhttp/webGui/scripts/reload_services
rm -f $job
echo "sleep 5;$reload $job"|at -M now 2>/dev/null
exit 0