From 657cdc7f1901ff924b0e2f8d6456e868d77c2f13 Mon Sep 17 00:00:00 2001 From: Javi Merino Date: Tue, 10 May 2016 18:26:44 +0100 Subject: [PATCH] lisa_shell: bind ipython server to eth0 when run from a vagrant environment When running inside vagrant with the default VirtualBox configuration, the host accesses the vm using a virtual ethernet link. "lisa-ipython start" uses loopback as the default interface, which makes the ipython server bind only to loopback and refuse connections from the host. Make "lisa-ipython start" bind to eth0 by default, which is the more sensible default in that environment. --- src/shell/lisa_shell | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) mode change 100644 => 100755 src/shell/lisa_shell diff --git a/src/shell/lisa_shell b/src/shell/lisa_shell old mode 100644 new mode 100755 index 598d423c0..57a9ae483 --- a/src/shell/lisa_shell +++ b/src/shell/lisa_shell @@ -170,7 +170,15 @@ rm -f $PIDFILE 2>/dev/null function lisa-ipython { CMD=${1:-start} -NETIF=${2:-lo} + +if [ "x$2" == "x" -a $USER == "vagrant" -a -e /vagrant/src/shell/lisa_shell ]; then + # NETIF not set and we are in a vagrant environment. Default to + # eth0 as loopback won't let you connect from your host machine. + NETIF="eth0" +else + NETIF=${2:-lo} +fi + PORT=${3:-8888} echo case "x${CMD^^}" in -- GitLab