launcher: Remove hard-coded paths to ip and ifconfig.
authorW-Mark Kubacki <wmark@hurrikane.de>
Wed, 15 Oct 2014 11:21:34 +0000 (13:21 +0200)
committerW-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]

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 | \