mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user