This commit is contained in:
lgp
2025-11-06 16:42:21 +08:00
commit 60b3c5714f
9 changed files with 192 additions and 0 deletions

19
scripts/stop.sh Normal file
View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
service_names=(
'open-im-media-server'
'open-im-signal-server'
)
for i in ${service_names[*]}; do
#Check whether the service exists
name="ps -aux |grep -w $i |grep -v grep"
count="${name}| wc -l"
if [ $(eval ${count}) -gt 0 ]; then
pid="${name}| awk '{print \$2}'"
echo -e "${SKY_BLUE_PREFIX}Killing service:$i pid:$(eval $pid)${COLOR_SUFFIX}"
#kill the service that existed
kill -9 $(eval $pid)
echo -e "${SKY_BLUE_PREFIX}service:$i was killed ${COLOR_SUFFIX}"
fi
done