Bash скрипт 1/FAILURE
[net] sv port 1111 nft bytes tmp 16423143
[net] sv port 1111 nft bytes old 16328411
строка difference=$(($tmp - $old)): 16423143
16423143 - 16328411: синтаксическая ошибка в выражении (неверный маркер «16423143 - 16328411»)
# Часть кода
tmp=$(nft -a list chain inet filter output | grep "sv_counter" | grep ${port} | awk '{ print $5 }')
if [[ -z $tmp ]]; then
nice=${SERVICE_NICE_LOW}
else
echo "[net] sv port ${port} nft bytes tmp ${tmp}"
name_old="${nft_prefix}_${port}"
old=${!name_old}
if [[ -z $old ]]; then
old=$tmp
fi
echo "[net] sv port ${port} nft bytes old ${old}"
eval ${nft_prefix}_${port}=$tmp
difference=$(($tmp - $old))
if [[ $difference -gt $bytes_idle ]]; then
echo "[net] sv port ${port} active, $difference gt $bytes_idle"
sv=1
nice=${nice_active}
else
nice=${SERVICE_NICE_LOW}
fi
fi
Перемещено hobbit из general