提交 46818223 编写于 作者: T Thomas Stromberg

Revert "Use ip route commands on Linux, as they show the subnet which may be required for deletion"

This reverts commit fc5256b2.
上级 fc5256b2
......@@ -53,7 +53,6 @@ BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_SYSTEMD_MACHINED=y
BR2_PACKAGE_SYSTEMD_VCONSOLE=y
BR2_PACKAGE_UTIL_LINUX_NSENTER=y
BR2_PACKAGE_UTIL_LINUX_SCHEDUTILS=y
BR2_TARGET_ROOTFS_CPIO_BZIP2=y
BR2_TARGET_ROOTFS_ISO9660=y
BR2_TARGET_ROOTFS_ISO9660_BOOT_MENU="$(BR2_EXTERNAL_MINIKUBE_PATH)/board/coreos/minikube/isolinux.cfg"
......
......@@ -162,19 +162,17 @@ if pgrep kubectl; then
fi
function cleanup_stale_routes() {
local show="netstat -rn -f inet"
local del="sudo route -n delete"
if [[ "$(uname)" == "Linux" ]]; then
show="ip route show"
del="sudo ip route delete"
stale_routes=$(netstat -rn -f inet | awk '{ print $1 }' | grep 10.96.0.0 || true)
if [[ "${stale_routes}" != "" ]]; then
echo "WARNING: deleting stale tunnel routes: ${stale_routes}"
for route in ${stale_routes}; do
if [[ "$(uname)" == "Linux" ]]; then
sudo ip route delete "${route}" || true
else
sudo route -n delete "${route}" || true
fi
done
fi
local troutes=$($show | awk '{ print $1 }' | grep 10.96.0.0 || true)
for route in ${troutes}; do
echo "WARNING: deleting stale tunnel route: ${route}"
$del "${route}" || true
done
}
cleanup_stale_routes || true
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册