mirror of
https://github.com/unraid/webgui.git
synced 2026-01-06 01:29:54 -06:00
WireGuard: delayed service update to avoid race condition
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
#!/bin/bash
|
||||
job=/tmp/wgjob.tmp
|
||||
reload=/usr/local/emhttp/webGui/scripts/reload_services
|
||||
lock=/tmp/atlock.tmp
|
||||
|
||||
rm -f $job
|
||||
echo "sleep 5;$reload $job"|at -M now 2>/dev/null
|
||||
rm -f $lock
|
||||
echo "sleep ${1:-1};/usr/local/emhttp/webGui/scripts/reload_services $lock"|at -M now 2>/dev/null
|
||||
exit 0
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
|
||||
ini=/var/local/emhttp/network.ini.new
|
||||
cfg=/boot/config/network.cfg
|
||||
job=/tmp/atjob.tmp
|
||||
reload=/usr/local/emhttp/webGui/scripts/reload_services
|
||||
|
||||
declare -A VLANID USE_DHCP IPADDR NETMASK GATEWAY METRIC USE_DHCP6 IPADDR6 NETMASK6 GATEWAY6 PRIVACY6 METRIC6 DESCRIPTION PROTOCOL
|
||||
|
||||
@@ -222,8 +220,7 @@ done
|
||||
/usr/bin/mv $ini ${ini%.*}
|
||||
|
||||
# delayed execution
|
||||
rm -f $job
|
||||
echo "sleep 35;$reload $job"|at -M now 2>/dev/null
|
||||
/usr/local/emhttp/webGui/scripts/update_services 35
|
||||
|
||||
# send update information
|
||||
if [[ -n $interface && -n $data && -e /var/run/nginx.socket ]]; then
|
||||
|
||||
Reference in New Issue
Block a user