-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathkill.sh
More file actions
executable file
·33 lines (26 loc) · 863 Bytes
/
kill.sh
File metadata and controls
executable file
·33 lines (26 loc) · 863 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
29
30
31
32
33
#!/usr/bin/env bash
# Copyright (c) 2021-2025 Datalayer, Inc.
# Distributed under the terms of the Modified BSD License.
# Copyright (c) 2021-2024 Datalayer, Inc.
# Distributed under the terms of the Modified BSD License.
# Copyright (c) Datalayer, Inc. https://datalayer.io
# Distributed under the terms of the MIT License.
uname_out="$(uname -s)"
case "${uname_out}" in
Linux*) export OS=LINUX;;
Darwin*) export OS=MACOS;;
# CYGWIN*) OS=CYGWIND;;
# MINGW*) OS=MINGW;;
*) export OS="UNSUPPORTED:${unameOut}"
esac
function kill_port() {
case "${OS}" in
LINUX) fuser -k $1/tcp;;
MACOS) lsof -i TCP:$1 | grep LISTEN | awk '{print $2}' | xargs kill -9;;
*) echo "Unsupported operating system ${OS}"
esac
}
kill_port 3208
kill_port 8080
kill_port 8686
kill_port 8888