Created
August 3, 2017 17:32
-
-
Save kd7lxl/f3ce8b281936946d633a5a9e6285b3f5 to your computer and use it in GitHub Desktop.
Detect a change in the route table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| PREVTABLE=/tmp/routes | |
| NEWTABLE=$(mktemp) | |
| ip r > "$NEWTABLE" | |
| if [ -f "$PREVTABLE" ]; then | |
| diff -u "$PREVTABLE" "$NEWTABLE" | |
| fi | |
| mv "$NEWTABLE" "$PREVTABLE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment