improve startup and runtime performance by 1) moving common startup procedures out of hotplug script when called from mwan3 start 2) reducing calls to iptables to check status of rules 3) consolidating iptables updates and updating with iptables-restore 4) do not wait for kill if nothing was killed 5) running interface hotplug scripts in parallel 6) eliminate operations in hotplug script that check status on every single interface unnecessarily 7) consolidate how mwan3track makes hotplug calls 8) do not restart mwan3track on connected events This is a significant refactor, but should not result in any breaking changes or require users to update their configurations. version bump to 2.9.0 Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
17 lines
377 B
Bash
17 lines
377 B
Bash
#!/bin/sh
|
|
|
|
get_uptime() {
|
|
local uptime=$(cat /proc/uptime)
|
|
echo "${uptime%%.*}"
|
|
}
|
|
|
|
SCRIPTNAME="$(basename "$0")"
|
|
LOG()
|
|
{
|
|
local facility=$1; shift
|
|
# in development, we want to show 'debug' level logs
|
|
# when this release is out of beta, the comment in the line below
|
|
# should be removed
|
|
[ "$facility" = "debug" ] && return
|
|
logger -t "$SCRIPTNAME[$$]" -p $facility "$*"
|
|
}
|