-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.sh
More file actions
executable file
·37 lines (29 loc) · 788 Bytes
/
main.sh
File metadata and controls
executable file
·37 lines (29 loc) · 788 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
34
35
36
#!/bin/bash
function priorities(){
while true
do
# Renice for pystemon
for pid in $(ps -def | grep pyst | grep -v grep | awk '{print $2}')
do
renice -n 20 $pid 2>&1 > /dev/null
done;
for pid in $(ps -def | grep curl | grep -v grep | awk '{print $2}')
do
renice -n 20 $pid 2>&1 > /dev/null
done;
# Kill if it's running for more than an hour (CPU TIME)
for pid in $(ps -def | grep curl | grep -v '00:00' | grep -v grep | awk '{print $2}')
do
kill $pid 2>&1 > /dev/null
echo $(date) " - Killed curl"
done;
sleep 10;
done;
}
priorities&
while true
do
python pystemon.py
echo '[-] Pystemon died'
sleep 5
done