Commit 9be3fbe3 authored by nanahira's avatar nanahira

run once after

parent 277bacd4
Pipeline #1933 passed with stage
in 3 minutes and 13 seconds
...@@ -3,10 +3,7 @@ ...@@ -3,10 +3,7 @@
# ROUTE_PLANS # ROUTE_PLANS
source /usr/src/app/route-plans source /usr/src/app/route-plans
while read dst others _calculate_route() {
do
if [[ "$dst" == "10.198.0."* ]] && [[ "$others" == *"proto $TARGET_PROTOCOL"* ]]
then
# 读 babeld 路由 # 读 babeld 路由
declare -A routes declare -A routes
while read -r dst others while read -r dst others
...@@ -39,5 +36,14 @@ do ...@@ -39,5 +36,14 @@ do
echo "route replace default dev $best_dev table $table" echo "route replace default dev $best_dev table $table"
fi fi
done | ip -batch - done | ip -batch -
}
_calculate_route
while read dst others
do
if [[ "$dst" == "10.198.0."* ]] && [[ "$others" == *"proto $TARGET_PROTOCOL"* ]]
then
_calculate_route
fi fi
done < <( ip monitor route ) done < <( ip monitor route )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment