projects
/
scripts.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Now tests for the presence of the gw ip in checkgw.
[scripts.git]
/
bashrc
diff --git
a/bashrc
b/bashrc
index
dbe21a4
..
3c4123e
100644
(file)
--- a/
bashrc
+++ b/
bashrc
@@
-344,7
+344,13
@@
function netdown () {
}
function checkgw () {
}
function checkgw () {
- ping $(route -n | grep ^0.0.0.0 | awk '{print $2}')
+ GW=$(route -n | grep ^0.0.0.0 | awk '{print $2}')
+ if [[ -n "${GW}" ]]; then
+ ping ${GW}
+ else
+ echo "Can not find a getaway." >&2
+ return 1
+ fi
}
######################################################################
}
######################################################################