From 813fef38ec5696339419b80ef23e8fb0c311df3e Mon Sep 17 00:00:00 2001 From: W-Mark Kubacki Date: Wed, 15 Oct 2014 13:21:34 +0200 Subject: [PATCH] launcher: Remove hard-coded paths to ip and ifconfig. Either we are root and the tools are in our PATH, or they don't exist. --- launcher | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) mode change 100755 => 100644 launcher diff --git a/launcher b/launcher old mode 100755 new mode 100644 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 | \ -- 2.25.1