mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-05 21:02:11 +08:00
Script Refactoring
This commit is contained in:
parent
4920b20d5a
commit
07a9deb297
@ -2873,6 +2873,20 @@ check_binary_ports() {
|
||||
}
|
||||
|
||||
|
||||
kill_binary() {
|
||||
binary_path="$1"
|
||||
|
||||
pids=$(pgrep -f "$binary_path")
|
||||
|
||||
if [ -z "$pids" ]; then
|
||||
echo "No process found for $binary_path"
|
||||
else
|
||||
for pid in $pids; do
|
||||
echo "Killing process $pid associated with $binary_path"
|
||||
kill -9 "$pid"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
19
scripts-new/stop.sh
Normal file
19
scripts-new/stop.sh
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
|
||||
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/
|
||||
source "${OPENIM_ROOT}/lib/util.sh"
|
||||
source "${OPENIM_ROOT}/define/binaries.sh"
|
||||
source "${OPENIM_ROOT}/lib/path.sh"
|
||||
|
||||
|
||||
|
||||
for binary in "${!binaries[@]}"; do
|
||||
expected_count=${binaries[$binary]}
|
||||
full_path=$(get_bin_full_path "$binary")
|
||||
kill_binary "$full_path"
|
||||
done
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user