travelmate: startup fixes

* fix a possible race condition during boot
* use the new "device" syntax in the network wizard

Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
Dirk Brenken 2021-06-25 23:15:06 +02:00
parent c8b6824d31
commit e407566cce
No known key found for this signature in database
GPG Key ID: 9D71CD547BFAE684
2 changed files with 10 additions and 3 deletions

View File

@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=travelmate
PKG_VERSION:=2.0.3
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>

View File

@ -1,7 +1,9 @@
#!/bin/sh /etc/rc.common
# Copyright (c) 2016-2021 Dirk Brenken (dev@brenken.org)
# This is free software, licensed under the GNU General Public License v3.
# set (s)hellcheck exceptions
# shellcheck disable=1091,2016,2034,2039,2059,2086,2143,2181,2188
# shellcheck disable=1091,2016,2034,2039,2059,2086,2143,2154,2181,2188
START=25
USE_PROCD=1
@ -26,6 +28,10 @@ start_service()
{
if [ "$("${trm_init}" enabled; printf "%u" ${?})" = "0" ]
then
if [ "${action}" = "boot" ]
then
return 0
fi
procd_open_instance "travelmate"
procd_set_param command "${trm_script}" "${@}"
procd_set_param pidfile "${trm_pidfile}"
@ -132,7 +138,7 @@ setup()
set network."${input}".proto="dhcp"
set network."${input}".metric="${metric}"
set network."${input}6"=interface
set network."${input}6".ifname="@${input}"
set network."${input}6".device="@${input}"
set network."${input}6".proto="dhcpv6"
commit travelmate
commit network
@ -190,5 +196,6 @@ service_triggers()
then
procd_add_interface_trigger "interface.*.down" "${iface}" "${trm_init}" reload
fi
procd_add_raw_trigger "interface.*.up" "${PROCD_RELOAD_DELAY}" "${trm_init}" start
procd_add_config_trigger "config.change" "travelmate" "${trm_init}" restart
}