Browse Source

travelmate: update 0.2.5

* small performance optimization, code cleanup
* change copyright notice in makefile
* documentation update

Signed-off-by: Dirk Brenken <dev@brenken.org>
lilik-openwrt-22.03
Dirk Brenken 8 years ago
parent
commit
32fb90fd68
3 changed files with 22 additions and 17 deletions
  1. +2
    -3
      net/travelmate/Makefile
  2. +11
    -4
      net/travelmate/files/README.md
  3. +9
    -10
      net/travelmate/files/travelmate.sh

+ 2
- 3
net/travelmate/Makefile View File

@ -1,13 +1,12 @@
#
# Copyright (C) 2016 OpenWrt.org
#
# Copyright (c) 2016 Dirk Brenken (dev@brenken.org)
# This is free software, licensed under the GNU General Public License v3.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=travelmate
PKG_VERSION:=0.2.4
PKG_VERSION:=0.2.5
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0+
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>


+ 11
- 4
net/travelmate/files/README.md View File

@ -18,16 +18,23 @@ To avoid these kind of deadlocks, travelmate set all station interfaces in an "a
* iw (default) or iwinfo for wlan scanning
## OpenWrt / LEDE trunk Installation & Usage
* download the package [here](https://downloads.lede-project.org/snapshots/packages/x86_64/packages)
* install 'travelmate' (_opkg install travelmate_)
* configure your network to support (multiple) wlan uplinks and set travelmate config options (details see below)
* set 'trm\_enabled' option in travelmate config to '1'
* travelmate starts automatically during boot, triggered by procd as soon as the wireless subsystem is up & running
## LuCI travelmate companion package
* download the package [here](https://downloads.lede-project.org/snapshots/packages/x86_64/luci)
* install 'luci-app-travelmate' (_opkg install luci-app-travelmate_)
* the application is located in LuCI under 'Services' menu
* _Thanks to Hannu Nyman for this great LuCI frontend!_
## Chaos Calmer installation notes
* 'travelmate' is _not_ available as an ipk package in the Chaos Calmer download repository
* download the package from a development snapshot package directory, i.e. look [here](https://downloads.lede-project.org/snapshots/packages/x86_64/packages/)
* manually transfer the package to your routers temp directory (with tools like _sshfs_ or _winscp_)
* install the package as described above
* 'travelmate' and 'luci-app-travelmate' are _not_ available as ipk packages in the Chaos Calmer download repository
* download the packages from a development snapshot directory (see download links above)
* manually transfer the packages to your routers temp directory (with tools like _sshfs_ or _winscp_)
* install the packages as described above
## Travelmate config options
* mandatory config options:


+ 9
- 10
net/travelmate/files/travelmate.sh View File

@ -11,7 +11,7 @@
LC_ALL=C
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
trm_pid="${$}"
trm_ver="0.2.4"
trm_ver="0.2.5"
trm_debug=0
trm_loop=30
trm_maxretry=3
@ -106,7 +106,7 @@ trm_check()
json_get_var trm_status up
if [ "${trm_status}" = "1" ] || [ -n "${trm_uplink}" ]
then
trm_log "debug" "check::: interface: ${interface}, status: ${trm_status}, uplink-sta: ${trm_uplink}, uplink-ssid: ${trm_ssid} count: ${cnt}"
trm_log "debug" "check::: interface: ${interface}, status: ${trm_status}, uplink-cfg: ${trm_uplink}, uplink-ssid: ${trm_ssid}, loop-cnt: ${cnt}, error-cnt: $((trm_count_${trm_config}))"
json_cleanup
break
fi
@ -119,6 +119,7 @@ trm_check()
ubus call network reload
eval "trm_count_${trm_uplink}=\$((trm_count_${trm_uplink}+1))"
trm_checklist=""
trm_uplink=""
trm_log "info" "uplink ${trm_ssid} get lost"
elif [ -z "${trm_uplink}" ] && [ -n "${trm_checklist}" ]
then
@ -189,7 +190,6 @@ while true
do
if [ -z "${trm_uplink}" ] || [ "${trm_status}" = "0" ]
then
trm_uplink=""
trm_aplist=""
trm_stalist=""
config_load wireless
@ -213,7 +213,7 @@ do
trm_network="${sta##*_}"
trm_ifname="$(uci -q get wireless."${trm_config}".ifname)"
trm_ssid="\"$(uci -q get wireless."${trm_config}".ssid)\""
if [ $((trm_count_${trm_config}_${trm_network})) -lt $((trm_maxretry)) ] || [ $((trm_maxretry)) -eq 0 ]
if [ $((trm_count_${trm_config})) -lt $((trm_maxretry)) ] || [ $((trm_maxretry)) -eq 0 ]
then
if [ -n "$(printf "${trm_ssidlist}" | grep -Fo "${trm_ssid}")" ]
then
@ -221,28 +221,27 @@ do
if [ "${trm_status}" = "1" ]
then
trm_checklist="${trm_network}"
trm_uplink="${trm_config}_${trm_network}"
trm_uplink="${trm_config}"
trm_set "defer"
trm_log "info" "wwan interface \"${trm_ifname}\" connected to uplink ${trm_ssid}"
break 2
else
trm_set "revert"
eval "trm_count_${trm_config}_${trm_network}=\$((trm_count_${trm_config}_${trm_network}+1))"
eval "trm_count_${trm_config}=\$((trm_count_${trm_config}+1))"
fi
fi
elif [ $((trm_count_${trm_config}_${trm_network})) -eq $((trm_maxretry)) ] && [ $((trm_maxretry)) -ne 0 ]
elif [ $((trm_count_${trm_config})) -eq $((trm_maxretry)) ] && [ $((trm_maxretry)) -ne 0 ]
then
eval "trm_count_${trm_config}_${trm_network}=\$((trm_count_${trm_config}_${trm_network}+1))"
eval "trm_count_${trm_config}=\$((trm_count_${trm_config}+1))"
trm_log "info" "uplink ${trm_ssid} disabled due to permanent connection failures"
fi
done
fi
sleep 5
done
sleep 5
else
trm_check
if [ -n "${trm_checklist}" ]
if [ -n "${trm_uplink}" ]
then
sleep ${trm_loop}
fi


Loading…
Cancel
Save