1 ##############################################################################
2 # Copyright (c) 2018 Mirantis Inc., Enea AB and others.
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
7 ##############################################################################
13 # Workaround salt-managed routes breaking ifup when route already exists
14 route_binary='/sbin/route'
15 route_output=$("${route_binary}" "$@" 2>&1)
18 if [ -n "${route_output}" ]; then
19 if echo "${route_output}" | grep -q 'SIOCADDRT: File exists'; then
22 echo "${route_output}"
24 exit "${route_return}"