aboutsummaryrefslogtreecommitdiff
path: root/net/travelmate
diff options
context:
space:
mode:
authorDirk Brenken <dev@brenken.org>2019-11-06 21:02:17 +0100
committerDirk Brenken <dev@brenken.org>2019-11-06 21:02:17 +0100
commit0d406b2a4236501b4aff21ed8dbd40bc191876da (patch)
tree9033428b72335c0648cc2cb4d3605ff86220e240 /net/travelmate
parent426ed75dbeec4448ee2cec16bf7c78ee7b3528dc (diff)
travelmate: update 1.5.2
* print to stdout if 'logger' is not available * add support to set the service nice level (default is 0) * small fixes / polish up for forthcoming 19.07 release Signed-off-by: Dirk Brenken <dev@brenken.org>
Diffstat (limited to 'net/travelmate')
-rw-r--r--net/travelmate/Makefile2
-rwxr-xr-xnet/travelmate/files/travelmate.init1
-rwxr-xr-xnet/travelmate/files/travelmate.sh16
3 files changed, 14 insertions, 5 deletions
diff --git a/net/travelmate/Makefile b/net/travelmate/Makefile
index 714981305..86a45725a 100644
--- a/net/travelmate/Makefile
+++ b/net/travelmate/Makefile
@@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=travelmate
-PKG_VERSION:=1.5.1
+PKG_VERSION:=1.5.2
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
diff --git a/net/travelmate/files/travelmate.init b/net/travelmate/files/travelmate.init
index c78524211..933255598 100755
--- a/net/travelmate/files/travelmate.init
+++ b/net/travelmate/files/travelmate.init
@@ -23,6 +23,7 @@ start_service()
procd_open_instance "travelmate"
procd_set_param command "${trm_script}" "${@}"
procd_set_param pidfile "${trm_pidfile}"
+ procd_set_param nice "$(uci_get travelmate extra trm_nice "0")"
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
diff --git a/net/travelmate/files/travelmate.sh b/net/travelmate/files/travelmate.sh
index 73effbc0b..411e135ef 100755
--- a/net/travelmate/files/travelmate.sh
+++ b/net/travelmate/files/travelmate.sh
@@ -13,7 +13,7 @@
#
LC_ALL=C
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
-trm_ver="1.5.1"
+trm_ver="1.5.2"
trm_enabled=0
trm_debug=0
trm_iface="trm_wwan"
@@ -34,6 +34,7 @@ trm_rtfile="/tmp/trm_runtime.json"
trm_fetch="$(command -v uclient-fetch)"
trm_iwinfo="$(command -v iwinfo)"
trm_wpa="$(command -v wpa_supplicant)"
+trm_logger="$(command -v logger)"
trm_action="${1:-"start"}"
trm_pidfile="/var/run/travelmate.pid"
@@ -100,6 +101,7 @@ f_envload()
if [ "${trm_enabled}" -ne 1 ]
then
f_log "info" "travelmate is currently disabled, please set 'trm_enabled' to '1' to use this service"
+ > "${trm_pidfile}"
exit 0
fi
@@ -482,12 +484,17 @@ f_log()
if [ -n "${log_msg}" ] && { [ "${class}" != "debug" ] || [ "${trm_debug}" -eq 1 ]; }
then
- logger -p "${class}" -t "travelmate-${trm_ver}[${$}]" "${log_msg}"
+ if [ -x "${trm_logger}" ]
+ then
+ "${trm_logger}" -p "${class}" -t "travelmate-${trm_ver}[${$}]" "${log_msg}"
+ else
+ printf "%s %s %s\\n" "${class}" "travelmate-${trm_ver}[${$}]" "${log_msg}"
+ fi
if [ "${class}" = "err" ]
then
trm_ifstatus="error"
f_jsnup
- logger -p "${class}" -t "travelmate-${trm_ver}[${$}]" "Please check 'https://github.com/openwrt/packages/blob/master/net/travelmate/files/README.md' (${trm_sysver})"
+ > "${trm_pidfile}"
exit 1
fi
fi
@@ -705,8 +712,9 @@ do
done
elif [ "${trm_action}" = "stop" ]
then
- > "${trm_rtfile}"
f_log "info" "travelmate instance stopped ::: action: ${trm_action}, pid: $(cat ${trm_pidfile} 2>/dev/null)"
+ > "${trm_rtfile}"
+ > "${trm_pidfile}"
exit 0
else
f_log "info" "travelmate instance started ::: action: ${trm_action}, pid: ${$}"