Commit 5a1f82a9 authored by Sebastian Wahl's avatar Sebastian Wahl

cleanup and better printouts in remote_jupyter_manager.sh

parent 0dbd4e16
......@@ -25,7 +25,7 @@ function connect() {
if [[ "$(uname)" == "Darwin" ]]; then
chrome=/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
ls "$chrome"
if [[ -f "$chrome" ]]; then
# TODO: disable warning output
"$chrome" --proxy-server='socks5://localhost:'${proxyport} $page &
......@@ -68,12 +68,14 @@ if [[ $# -lt 2 ]] || [[ "$1" == "-h" ]]; then
echo
exit 1
fi
set -vx
# set -vx
hname=$1
task=$2
proxyport=54321
[[ $# -eq 3 ]] && proxyport=$3
echo
if [[ "$task" == "start" ]] || [[ "$task" == "connect" ]]; then
page=$(ssh $hname "\${HOME}/miniconda3/bin/python \${HOME}/miniconda3/bin/jupyter notebook list" | grep http | awk '{print$1}')
......@@ -84,10 +86,10 @@ if [[ "$task" == "start" ]] || [[ "$task" == "connect" ]]; then
echo " Wait until you see the URL of the server and then hit Ctrl+C to continue"
ssh $hname "\${HOME}/miniconda3/bin/python \${HOME}/miniconda3/bin/jupyter lab --no-browser --ip 127.0.0.1 "
echo " Jupyterlab on $hname started"
echo
else
echo " Jupyterlab on $hname, port $port already running. Connecting to existing server."
fi
echo
connect $hname $proxyport
elif [[ "$task" == "stop" ]]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment