-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotebook
More file actions
28 lines (28 loc) · 941 Bytes
/
notebook
File metadata and controls
28 lines (28 loc) · 941 Bytes
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
#!/usr/bin/env bash
###
# start, stop, and check status
# of Jupyter notebook
################################################################
case ${1} in
start)
# start jupyter notebook on public ip port 8888
jupyter notebook --ip=0.0.0.0 --no-browser &
;;
stop)
killall jupyter-notebook
;;
status)
check=$(ps -ef | grep jupyter-notebook)
if [[ ${check} != *'python'* ]];then
echo "Jupyter notebook is stopped"
exit 0
else
PID=$(echo ${check} | awk '{print $2}')
echo "Jupiter is running on pid ${PID}"
fi
;;
*)
echo "Jupyter Notebook Server Operations"
echo "Usage: jn {start|stop|status}"
exit 1
esac