travelmate: bugfix 1.3.7

* fix a possible 'reload' race condition

Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
Dirk Brenken 2019-02-23 07:55:26 +01:00
parent a423fd57bb
commit feca82971a
3 changed files with 5 additions and 5 deletions

View file

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

View file

@ -31,14 +31,14 @@ start_service()
reload_service()
{
local ppid pid
local ppid pid timeout="$(uci_get travelmate global trm_timeout)"
if [ -s "${trm_pidfile}" ]
then
ppid="$(cat "${trm_pidfile}" 2>/dev/null)"
if [ -n "${ppid}" ]
then
pid="$(pgrep sleep -P ${ppid} 2>/dev/null)"
pid="$(pgrep -xnf "sleep ${timeout:-60} 0" -P ${ppid} 2>/dev/null)"
if [ -n "${pid}" ]
then
kill -INT ${pid} 2>/dev/null

View file

@ -10,7 +10,7 @@
#
LC_ALL=C
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
trm_ver="1.3.6"
trm_ver="1.3.7"
trm_sysver="unknown"
trm_enabled=0
trm_debug=0
@ -474,7 +474,7 @@ do
f_check "initial"
if [ "${trm_ifstatus}" = "true" ]
then
sleep ${trm_timeout}
sleep ${trm_timeout} 0
fi
if [ $? -eq 0 ] || [ "${trm_ifstatus}" = "false" ]
then