Skip to content

Commit

Permalink
Change sleep duration for omr-tracker after error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed Sep 14, 2023
1 parent 517ffd4 commit 8390c42
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mptcp/files/usr/share/omr/post-tracking.d/001-post-tracking
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8390c42

Please sign in to comment.