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>
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
* 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
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
# 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
{ [ "${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))"
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
#!/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
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