github.com/yunabe/lgo@v0.0.0-20190709125917-42c42d410fdf/docker/jupyter/up.sh (about)

     1  #!/bin/bash
     2  
     3  docker-compose up -d
     4  url=$(docker-compose exec jupyter jupyter notebook list | grep http | awk '{print $1}')
     5  if [[ -z $url ]]; then
     6      echo Cannot determine url
     7      exit 1
     8  fi
     9  
    10  if [[ "$OSTYPE" == "linux-gnu" ]]; then
    11      xdg-open $url
    12  elif [[ "$OSTYPE" == "darwin"* ]]; then
    13      open $url
    14  else
    15      echo $url
    16  fi