-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentrypoint.sh
executable file
·39 lines (28 loc) · 930 Bytes
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# For a command line such as:
# "/home/jovyan/entrypoint.sh jupyter notebook --ip 0.0.0.0 --port 59537 --NotebookApp.custom_display_url=http://127.0.0.1:59537"
# strip out most args, just pass on the port
collect_port=0
port="8888"
delim='='
for var in "$@"
do
echo "$var"
if [ "$collect_port" == "1" ]; then
echo "Collecting external port $var"
port=$var
collect_port=0
fi
splitarg=${var%%$delim*}
if [ "$splitarg" == "--port" ]; then
if [ ${#splitarg} == ${#var} ]; then
collect_port=1
else
port=${var#*$delim}
echo "Setting external port $port"
fi
fi
done
destport=$((port + 1))
echo "Using internal port $destport"
jhsingle-native-proxy --destport $destport --authtype none voila /home/jovyan/Presentation.ipynb {--}port={port} {--}no-browser {--}Voila.base_url={base_url}/ {--}Voila.server_url=/ --port $port