Browse Source

travelmate: update 1.3.6

* add captive portal domains automatically to the related
  domain whitelist (dhcp option 'rebind_domain'),
  if rebind protection/RFC1918 is enabled

Signed-off-by: Dirk Brenken <dev@brenken.org>
lilik-openwrt-22.03
Dirk Brenken 6 years ago
parent
commit
a423fd57bb
3 changed files with 23 additions and 20 deletions
  1. +1
    -1
      net/travelmate/Makefile
  2. +0
    -8
      net/travelmate/files/README.md
  3. +22
    -11
      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:=1.3.5
PKG_VERSION:=1.3.6
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0+
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>


+ 0
- 8
net/travelmate/files/README.md View File

@ -124,14 +124,6 @@ edit /etc/config/travelmate and set 'trm_enabled' to '1'
/etc/init.d/travelmate restart
</code></pre>
## FAQ
**Q:** What happen with misconfigured, faulty uplinks, e.g. due to outdated wlan passwords?
**A:** Travelmate tries n times (default 3) to connect, then the respective uplink will be marked as "faulty" in the JSON runtime file and hereafter ignored. To reset the JSON runtime file, simply restart travelmate.
**Q:** How to connect to hidden uplinks?
**A:** See 'example\_hidden' STA configuration above, option 'SSID' and 'BSSID' must be specified for successful connections.
**Q:** Any recommendations regarding suitable DNS settings to easily connect to captive portals?
**A:** Use a simple DNS forwarder like dnsmasq and disable the option 'rebind_protection'.
## Support
Please join the travelmate discussion in this [forum thread](https://forum.lede-project.org/t/travelmate-support-thread/5155) or contact me by [mail](mailto:dev@brenken.org)


+ 22
- 11
net/travelmate/files/travelmate.sh View File

@ -10,7 +10,7 @@
#
LC_ALL=C
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
trm_ver="1.3.5"
trm_ver="1.3.6"
trm_sysver="unknown"
trm_enabled=0
trm_debug=0
@ -47,6 +47,10 @@ f_envload()
{
local sys_call sys_desc sys_model
# (re-)initialize global list variables
#
unset trm_devlist trm_stalist trm_radiolist trm_active_sta
# get system information
#
sys_call="$(ubus -S call system board 2>/dev/null)"
@ -57,9 +61,10 @@ f_envload()
trm_sysver="${sys_model}, ${sys_desc}"
fi
# (re-)initialize global list variables
# get eap capabilities and rebind setting
#
unset trm_devlist trm_stalist trm_radiolist trm_active_sta
trm_eap="$("${trm_wpa}" -veap >/dev/null 2>&1; printf "%u" ${?})"
trm_rebind="$(uci_get dhcp "@dnsmasq[0]" rebind_protection)"
# load config and check 'enabled' option
#
@ -101,7 +106,7 @@ f_envload()
#
f_prep()
{
local eap_rc=1 config="${1}" proactive="${2}"
local config="${1}" proactive="${2}"
local mode="$(uci_get wireless "${config}" mode)"
local network="$(uci_get wireless "${config}" network)"
local radio="$(uci_get wireless "${config}" device)"
@ -127,24 +132,20 @@ f_prep()
then
trm_active_sta="${config}"
fi
if [ -n "${eaptype}" ]
then
eap_rc="$("${trm_wpa}" -veap >/dev/null 2>&1; printf "%u" ${?})"
fi
if [ -z "${eaptype}" ] || [ ${eap_rc} -eq 0 ]
if [ -z "${eaptype}" ] || ([ -n "${eaptype}" ] && [ ${trm_eap} -eq 0 ])
then
trm_stalist="$(f_trim "${trm_stalist} ${config}-${radio}")"
fi
fi
fi
f_log "debug" "f_prep ::: config: ${config}, mode: ${mode}, network: ${network}, eap_rc: ${eap_rc}, radio: ${radio}, trm_radio: ${trm_radio:-"-"}, trm_active_sta: ${trm_active_sta:-"-"}, proactive: ${proactive}, disabled: ${disabled}"
f_log "debug" "f_prep ::: config: ${config}, mode: ${mode}, network: ${network}, radio: ${radio}, trm_radio: ${trm_radio:-"-"}, trm_active_sta: ${trm_active_sta:-"-"}, proactive: ${proactive}, trm_eap: ${trm_eap}, trm_rebind: ${trm_rebind}, disabled: ${disabled}"
}
# check interface status
#
f_check()
{
local IFS ifname radio dev_status config sta_essid sta_bssid result wait=1 mode="${1}" status="${2:-"false"}"
local IFS ifname radio dev_status config sta_essid sta_bssid result cp_domain wait=1 mode="${1}" status="${2:-"false"}"
trm_ifquality=0
if [ "${mode}" = "initial" ]
@ -219,6 +220,16 @@ f_check()
awk '/^Redirected/{printf "%s" "net cp \047"$NF"\047";exit}/^Download completed/{printf "%s" "net ok";exit}/^Failed|^Connection error/{printf "%s" "net nok";exit}')"
if [ -n "${result}" ] && ([ -z "${trm_connection}" ] || [ "${result}" != "${trm_connection%/*}" ])
then
cp_domain="$(printf "%s" "${result}" | awk -F "['| ]" '/^net cp/{printf "%s" $4}')"
if [ -x "/etc/init.d/dnsmasq" ] && [ -n "${cp_domain}" ]
then
if [ -z "$(uci_get dhcp "@dnsmasq[0]" rebind_domain | grep -Fo "${cp_domain}")" ]
then
uci -q add_list dhcp.@dnsmasq[0].rebind_domain="${cp_domain}"
uci_commit dhcp
/etc/init.d/dnsmasq reload
fi
fi
trm_connection="${result}/${trm_ifquality}"
f_jsnup
fi


Loading…
Cancel
Save