projects
/
scripts.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d2dc8b0
)
Now tests for the presence of the gw ip in checkgw.
author
Francois Fleuret
<francois@fleuret.org>
Fri, 11 Mar 2011 16:43:14 +0000
(17:43 +0100)
committer
Francois Fleuret
<francois@fleuret.org>
Fri, 11 Mar 2011 16:43:14 +0000
(17:43 +0100)
bashrc
patch
|
blob
|
history
diff --git
a/bashrc
b/bashrc
index
dbe21a4
..
3c4123e
100644
(file)
--- a/
bashrc
+++ b/
bashrc
@@
-344,7
+344,13
@@
function netdown () {
}
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
}
######################################################################