projects
/
discourse_docker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
074f2b6
)
launcher: Remove hard-coded paths to ip and ifconfig.
author
W-Mark Kubacki
<wmark@hurrikane.de>
Wed, 15 Oct 2014 11:21:34 +0000
(13:21 +0200)
committer
W-Mark Kubacki
<wmark@hurrikane.de>
Wed, 15 Oct 2014 11:21:34 +0000
(13:21 +0200)
Either we are root and the tools are in our PATH, or they don't exist.
launcher
[changed mode: 0755->0644]
patch
|
blob
|
blame
|
history
diff --git
a/launcher
b/launcher
old mode 100755
(executable)
new mode 100644
(file)
index
c39d8a9
..
bd6f7bc
--- a/
launcher
+++ b/
launcher
@@
-24,12
+24,12
@@
else
attach_on_run="-d"
fi
-if [ -x
/sbin/ip
]; then
- docker_ip=`
/sbin/
ip addr show docker0 | \
+if [ -x
"$(which ip 2>/dev/null)"
]; then
+ docker_ip=`ip addr show docker0 | \
grep 'inet ' | \
awk '{ split($2,a,"/"); print a[1] }';`
else
- docker_ip=`
/sbin/
ifconfig | \
+ docker_ip=`ifconfig | \
grep -B1 "inet addr" | \
awk '{ if ( $1 == "inet" ) { print $2 } else if ( $2 == "Link" ) { printf "%s:" ,$1 } }' | \
grep docker0 | \