forked from metal0/catbot-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstop
More file actions
executable file
·38 lines (32 loc) · 1.11 KB
/
stop
File metadata and controls
executable file
·38 lines (32 loc) · 1.11 KB
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
34
35
36
37
38
#!/bin/bash
#
# This script stops all processes of steam and TF2
#
sudo kill $(cat /tmp/cat-ipc-server.pid /tmp/ncat-cathook-webpanel.pid /tmp/ncat-account-generator.pid)
sudo rm /tmp/ncat-account-generator.pid
sudo rm /tmp/ncat-cathook-webpanel.pid
sudo rm /tmp/cat-ipc-server.pid
xhost -
ipcserver=$( ps faux | grep '/opt/cathook/ipc/bin/server' | grep -vw grep | awk '{ print $2 }' );
[ ! -z "$ipcserver" ] && sudo kill ${ipcserver};
ipcconsole=$( ps faux | grep '/opt/cathook/ipc/bin/console' | grep -vw grep | awk '{ print $2 }' );
[ ! -z "$ipcconsole" ] && sudo kill ${ipcconsole};
count=$(cat ./users);
kisak=$(cat ./kisak);
if [ -z "$count" ]
then
echo "User count not found. Can't kill tf2 processes."
else
if [ -z "$kisak" ]
then
echo "Username not found. Can't kill tf2 processes."
else
for i in $(seq 1 $count)
do
echo "Killing tf2 for ${kisak}-${i}"
tf2=$(pgrep -u "${kisak}-${i}" hl2_linux);
steam=$(pgrep -u "${kisak}-${i}" steam);
([ ! -z "$tf2" ] || [ ! -z "$steam" ]) && sudo kill -9 $tf2 $steam
done
fi
fi