From: W-Mark Kubacki Date: Wed, 15 Oct 2014 11:21:34 +0000 (+0200) Subject: launcher: Remove hard-coded paths to ip and ifconfig. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=813fef38ec5696339419b80ef23e8fb0c311df3e;p=discourse_docker.git 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. --- 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 | \