mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
mwan3: make it clearer who initiated the start
It was somewhat opaque how the variable a is questioned. To show this better the variable is now a string and not a boolean. So you can see directly what should happen. With a boolean you always have to think about what it means when 0 or 1 is used. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
@@ -955,12 +955,12 @@ mwan3_interface_shutdown()
|
||||
|
||||
mwan3_ifup()
|
||||
{
|
||||
local up l3_device status interface true_iface mwan3_startup
|
||||
local interface=$1
|
||||
local caller=$2
|
||||
|
||||
interface=$1
|
||||
mwan3_startup=$2
|
||||
local up l3_device status true_iface
|
||||
|
||||
if [ "${mwan3_startup}" != 1 ]; then
|
||||
if [ "${caller}" = "cmd" ]; then
|
||||
# It is not necessary to obtain a lock here, because it is obtained in the hotplug
|
||||
# script, but we still want to do the check to print a useful error message
|
||||
/etc/init.d/mwan3 running || {
|
||||
@@ -979,7 +979,7 @@ mwan3_ifup()
|
||||
}
|
||||
hotplug_startup()
|
||||
{
|
||||
env -i MWAN3_STARTUP=$mwan3_startup ACTION=ifup \
|
||||
env -i MWAN3_STARTUP=$caller ACTION=ifup \
|
||||
INTERFACE=$interface DEVICE=$l3_device \
|
||||
sh /etc/hotplug.d/iface/15-mwan3
|
||||
}
|
||||
@@ -988,7 +988,7 @@ mwan3_ifup()
|
||||
return
|
||||
fi
|
||||
|
||||
if [ "${mwan3_startup}" = 1 ]; then
|
||||
if [ "${caller}" = "init" ]; then
|
||||
hotplug_startup &
|
||||
hotplug_pids="$hotplug_pids $!"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user