Adds route only if metadata url is not accessible

Verifies if the metadata url is not accessible before
adding a static route.
Checks the exit code when adding a static route