Skip to content
Snippets Groups Projects
Commit 3c2487c2 authored by Claudio Pisa's avatar Claudio Pisa
Browse files

Bugfix: two or more default routes with metric 0

This commit fixes the following bug:
When two or more default routes with metric 0 where in place, the update-status
hook fails to check that the default gateway is correctly set.
parent 5c86368d
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@ GATEWAY_IP="$( echo "$GATEWAY" | awk -F "/" '{print $1}' )"
DEFAULTROUTECOMMAND="$( getdefaultroutecommand )"
if eval $DEFAULTROUTECOMMAND | grep "\<${GATEWAY_IP}\>"; then
if [ $(eval $DEFAULTROUTECOMMAND | wc -l ) -eq 1 ] && eval $DEFAULTROUTECOMMAND | grep "\<${GATEWAY_IP}\>"; then
juju-log "Default gateway looks OK. Doing nothing."
exit 0
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment