travelmate: update to 2.1.3-1

* fixed STA connection issues / restart the travelmate interface on new connections via ubus
* fixed NTP hotplug issues / trigger the NTP hotplug event via ubus
* fixed minor log issues (mail/hotplug)
* readme update

Signed-off-by: Dirk Brenken <dev@brenken.org>
This commit is contained in:
Dirk Brenken
2024-09-14 13:48:27 +02:00
parent 86ad54b482
commit 7f976e1602
5 changed files with 34 additions and 14 deletions
+3 -3
View File
@@ -6,8 +6,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=travelmate
PKG_VERSION:=2.1.2
PKG_RELEASE:=6
PKG_VERSION:=2.1.3
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
@@ -22,7 +22,7 @@ define Package/travelmate
endef
define Package/travelmate/description
A wlan connection manager for travel router.
A wlan connection manager for travel routers.
Please see https://github.com/openwrt/packages/blob/master/net/travelmate/files/README.md for further information.
endef
+10
View File
@@ -230,5 +230,15 @@ Please join the Travelmate discussion in this [forum thread](https://forum.openw
* stop the Travelmate daemon with _/etc/init.d/travelmate stop_
* remove the Travelmate package (_opkg remove luci-app-travelmate_, _opkg remove travelmate_)
## Donations
You like this project - is there a way to donate? Generally speaking "No" - I have a well-paying full-time job and my OpenWrt projects are just a hobby of mine in my spare time.
If you still insist to donate some bucks ...
* I would be happy if you put your money in kind into other, social projects in your area, e.g. a children's hospice
* Let's meet and invite me for a coffee if you are in my area, the “Markgräfler Land” in southern Germany or in Switzerland (Basel)
* Send your money to my [PayPal account](https://www.paypal.me/DirkBrenken) and I will collect your donations over the year to support various social projects in my area
No matter what you decide - thank you very much for your support!
Have fun!
Dirk
+7 -4
View File
@@ -18,11 +18,14 @@ trm_mailreceiver="$(uci_get travelmate global trm_mailreceiver)"
trm_mailprofile="$(uci_get travelmate global trm_mailprofile "trm_notify")"
trm_mailsender="$(uci_get travelmate global trm_mailsender "no-reply@travelmate")"
trm_rtfile="$(uci_get travelmate global trm_rtfile "/tmp/trm_runtime.json")"
trm_mailpgm="$(command -v msmtp)"
trm_mailcmd="$(command -v msmtp)"
trm_ubuscmd="$(command -v ubus)"
trm_jsoncmd="$(command -v jsonfilter)"
trm_logger="$(command -v logger)"
trm_ver="$("${trm_ubuscmd}" -S call rpc-sys packagelist '{ "all": true }' 2>/dev/null | "${trm_jsoncmd}" -ql1 -e '@.packages.travelmate')"
if [ -z "${trm_mailreceiver}" ]; then
"${trm_logger}" -p "err" -t "trm-mail [${$}]" "please set the mail receiver with the 'trm_mailreceiver' option" 2>/dev/null
"${trm_logger}" -p "err" -t "trm-${trm_ver}[${$}]" "please set the mail receiver with the 'trm_mailreceiver' option" 2>/dev/null
exit 1
fi
@@ -50,5 +53,5 @@ trm_mailtext="${trm_mailtext}</pre></body></html>"
# send mail
#
printf "%b" "${trm_mailhead}${trm_mailtext}" 2>/dev/null | "${trm_mailpgm}" ${debug} -a "${trm_mailprofile}" "${trm_mailreceiver}" >/dev/null 2>&1
"${trm_logger}" -p "info" -t "trm-mail [${$}]" "mail sent to '${trm_mailreceiver}' with rc '${?}'" 2>/dev/null
printf "%b" "${trm_mailhead}${trm_mailtext}" 2>/dev/null | "${trm_mailcmd}" ${debug} -a "${trm_mailprofile}" "${trm_mailreceiver}" >/dev/null 2>&1
"${trm_logger}" -p "info" -t "trm-${trm_ver}[${$}]" "mail sent to '${trm_mailreceiver}' with rc '${?}'" 2>/dev/null
+8 -4
View File
@@ -669,6 +669,11 @@ f_check() {
{ [ "${mode}" = "dev" ] && { [ "${status}" = "false" ] || { [ "${trm_ifstatus}" != "${status}" ] && [ "${enabled}" = "0" ]; }; }; }; then
f_wifi
fi
if [ "${mode}" = "sta" ]; then
"${trm_ubuscmd}" -S call network.interface."${trm_iface}" down >/dev/null 2>&1
"${trm_ubuscmd}" -S call network.interface."${trm_iface}" up >/dev/null 2>&1
fi
while [ "${wait_time}" -le "${trm_maxwait}" ]; do
[ "${wait_time}" -gt "0" ] && sleep 1
wait_time="$((wait_time + 1))"
@@ -1025,11 +1030,10 @@ else
f_log "err" "system libraries not found"
fi
# force ntp restart/sync
# force ntp hotplug event/time sync
#
if [ -f "/etc/init.d/sysntpd" ] && [ ! -s "${trm_ntpfile}" ]; then
/etc/init.d/sysntpd restart >/dev/null 2>&1
f_log "debug" "ntp time sync requested"
if [ ! -s "${trm_ntpfile}" ]; then
"${trm_ubuscmd}" -S call hotplug.ntp call '{ "env": [ "ACTION=stratum" ] }' >/dev/null 2>&1
fi
# control travelmate actions
+6 -3
View File
@@ -1,6 +1,6 @@
#!/bin/sh
# ntp hotplug script for travelmate
# Copyright (c) 2020-2023 Dirk Brenken (dev@brenken.org)
# Copyright (c) 2020-2024 Dirk Brenken (dev@brenken.org)
# This is free software, licensed under the GNU General Public License v3.
# set (s)hellcheck exceptions
@@ -8,9 +8,12 @@
trm_init="/etc/init.d/travelmate"
trm_ntpfile="/var/state/travelmate.ntp"
trm_logger="$(command -v logger)"
if [ "${ACTION}" = "stratum" ] && [ ! -s "${trm_ntpfile}" ] && "${trm_init}" enabled; then
printf "%s" "$(date "+%Y.%m.%d-%H:%M:%S")" > "${trm_ntpfile}"
"${trm_logger}" -p "info" -t "trm-ntp [${$}]" "get ntp time sync"
trm_ubuscmd="$(command -v ubus)"
trm_jsoncmd="$(command -v jsonfilter)"
trm_logger="$(command -v logger)"
trm_ver="$("${trm_ubuscmd}" -S call rpc-sys packagelist '{ "all": true }' 2>/dev/null | "${trm_jsoncmd}" -ql1 -e '@.packages.travelmate')"
"${trm_logger}" -p "info" -t "trm-${trm_ver}[${$}]" "get ntp time sync"
fi