We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 74970ea commit c3aec7dCopy full SHA for c3aec7d
dev/kill-jupyter-server.sh
@@ -3,8 +3,22 @@
3
# Copyright (c) Datalayer, Inc. https://datalayer.io
4
# Distributed under the terms of the MIT License.
5
6
+uname_out="$(uname -s)"
7
+
8
+case "${uname_out}" in
9
+ Linux*) export OS=LINUX;;
10
+ Darwin*) export OS=MACOS;;
11
+# CYGWIN*) OS=CYGWIND;;
12
+# MINGW*) OS=MINGW;;
13
+ *) export OS="UNSUPPORTED:${unameOut}"
14
+esac
15
16
function kill_port() {
- lsof -i TCP:$1 | grep LISTEN | awk '{print $2}' | xargs kill -9
17
+ case "${OS}" in
18
+ LINUX) fuser -k $1/tcp;;
19
+ MACOS) lsof -i TCP:$1 | grep LISTEN | awk '{print $2}' | xargs kill -9;;
20
+ *) echo "Unsupported operating system ${OS}"
21
+ esac
22
}
23
24
kill_port 8888
0 commit comments