Browse Source

travelmate: update 0.5.0

* fix stop action in "active" mode
* fix race condition in "active" mode

Signed-off-by: Dirk Brenken <dev@brenken.org>
lilik-openwrt-22.03
Dirk Brenken 8 years ago
parent
commit
fa42066a6e
4 changed files with 19 additions and 14 deletions
  1. +1
    -1
      net/travelmate/Makefile
  2. +1
    -0
      net/travelmate/files/travelmate.conf
  3. +11
    -10
      net/travelmate/files/travelmate.init
  4. +6
    -3
      net/travelmate/files/travelmate.sh

+ 1
- 1
net/travelmate/Makefile View File

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


+ 1
- 0
net/travelmate/files/travelmate.conf View File

@ -4,6 +4,7 @@
config travelmate 'global'
option trm_enabled '0'
option trm_debug '0'
option trm_iface 'wan wwan'
option trm_active '0'
option trm_maxwait '30'
option trm_maxretry '3'


+ 11
- 10
net/travelmate/files/travelmate.init View File

@ -3,6 +3,7 @@
START=85
USE_PROCD=1
trm_init="/etc/init.d/travelmate"
trm_script="/usr/bin/travelmate.sh"
boot()
@ -23,18 +24,18 @@ start_service()
fi
}
stop_service()
{
killall -q -TERM "travelmate.sh"
}
service_triggers()
{
local iface="$(uci -q get travelmate.global.trm_iface)"
if [ -z "${iface}" ]
then
procd_add_raw_trigger "interface.*.down" 1000 /etc/init.d/travelmate start
else
for name in ${iface}
do
procd_add_interface_trigger "interface.*.down" "${name}" /etc/init.d/travelmate start
done
fi
procd_add_config_trigger "config.change" "travelmate" /etc/init.d/travelmate start
for name in ${iface}
do
procd_add_interface_trigger "interface.*.down" "${name}" "${trm_init}" start
done
procd_add_config_trigger "config.change" "travelmate" "${trm_init}" start
}

+ 6
- 3
net/travelmate/files/travelmate.sh View File

@ -10,7 +10,7 @@
#
LC_ALL=C
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
trm_ver="0.4.2"
trm_ver="0.5.0"
trm_sysver="$(ubus -S call system board | jsonfilter -e '@.release.description')"
trm_enabled=1
trm_debug=0
@ -233,6 +233,9 @@ f_main()
}
f_envload
f_main
f_active
if [ ${trm_active} -eq 0 ] || ([ ${trm_active} -eq 1 ] && [ $(pgrep -f "/usr/bin/travelmate.sh" | wc -l) -eq 3 ])
then
f_main
f_active
fi
exit 0

Loading…
Cancel
Save