1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-13 10:59:13 +02:00

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_NAME:=travelmate
PKG_VERSION:=2.0.3 PKG_VERSION:=2.0.3
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org> PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>

View File

@ -1,7 +1,9 @@
#!/bin/sh /etc/rc.common #!/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 # 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 START=25
USE_PROCD=1 USE_PROCD=1
@ -26,6 +28,10 @@ start_service()
{ {
if [ "$("${trm_init}" enabled; printf "%u" ${?})" = "0" ] if [ "$("${trm_init}" enabled; printf "%u" ${?})" = "0" ]
then then
if [ "${action}" = "boot" ]
then
return 0
fi
procd_open_instance "travelmate" procd_open_instance "travelmate"
procd_set_param command "${trm_script}" "${@}" procd_set_param command "${trm_script}" "${@}"
procd_set_param pidfile "${trm_pidfile}" procd_set_param pidfile "${trm_pidfile}"
@ -132,7 +138,7 @@ setup()
set network."${input}".proto="dhcp" set network."${input}".proto="dhcp"
set network."${input}".metric="${metric}" set network."${input}".metric="${metric}"
set network."${input}6"=interface set network."${input}6"=interface
set network."${input}6".ifname="@${input}" set network."${input}6".device="@${input}"
set network."${input}6".proto="dhcpv6" set network."${input}6".proto="dhcpv6"
commit travelmate commit travelmate
commit network commit network
@ -190,5 +196,6 @@ service_triggers()
then then
procd_add_interface_trigger "interface.*.down" "${iface}" "${trm_init}" reload procd_add_interface_trigger "interface.*.down" "${iface}" "${trm_init}" reload
fi fi
procd_add_raw_trigger "interface.*.up" "${PROCD_RELOAD_DELAY}" "${trm_init}" start
procd_add_config_trigger "config.change" "travelmate" "${trm_init}" restart procd_add_config_trigger "config.change" "travelmate" "${trm_init}" restart
} }