1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-13 02:51:50 +00:00

Change sleep duration for omr-tracker after error

This commit is contained in:
Ycarus (Yannick Chabanois) 2023-09-14 11:13:47 +02:00
parent 517ffd4567
commit 8390c42e12

View file

@ -744,7 +744,7 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || [ "$interface_up" != "true" ]; then
modem_device=$(mmcli -m $modem -K | grep 'modem.generic.device ' | awk '{print $3}')
[ -n "$modem_device" ] && modem_interface=$(uci show network | grep $modem_device | awk -F. '{print $2}')
[ -n "$modem_interface" ] && {
_log "No anwser from $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE), restart associed interface $modem_interface"
_log "No answer from $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE), restart associed interface $modem_interface"
ifup $modem_interface
}
fi
@ -900,9 +900,9 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ] || [ "$interface_up" != "true" ]; then
# Set a little sleep after an interface error
if [ -n "$RANDOM" ]; then
sleep `expr $RANDOM % 10`
sleep `expr $RANDOM % 100`
else
sleep `awk 'BEGIN{srand();print int(rand()*9)}'`
sleep `awk 'BEGIN{srand();print int(rand()*20)}'`
fi
exit 0