Skip to content

Commit

Permalink
Update entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
commoodor authored Aug 8, 2024
1 parent 58cd955 commit aec4c04
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions entrypoint
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
#!/bin/bash
cpu_threads=$(grep -c '^processor' /proc/cpuinfo)
echo "SRBMiner with Param: --algorithm $ALGO --pool $POOL_ADDRESS --wallet $WALLET_USER.$WORKER --password $PASSWORD $EXTRAS --cpu-threads $cpu_threads --keepalive true"
./SRBMiner-MULTI --algorithm $ALGO --pool $POOL_ADDRESS --wallet $WALLET_USER.$WORKER --password $PASSWORD $EXTRAS --cpu-threads $cpu_threads --keepalive true

# Calculate the number of CPU threads and adjust to one less
total_threads=$(grep -c '^processor' /proc/cpuinfo)
cpu_threads=$((total_threads - 1))

# Ensure that the number of CPU threads is not negative
if [ "$cpu_threads" -lt 1 ]; then
cpu_threads=1
fi

# Log the command for debugging
echo "Starting SRBMiner with parameters:"
echo "--algorithm $ALGO"
echo "--pool $POOL_ADDRESS"
echo "--wallet $WALLET_USER.$WORKER"
echo "--password $PASSWORD"
echo "--extras $EXTRAS"
echo "--cpu-threads $cpu_threads"
echo "--keepalive true"

# Run with the configured parameters
exec ./SRBMiner-MULTI \
--algorithm "$ALGO" \
--pool "$POOL_ADDRESS" \
--wallet "$WALLET_USER.$WORKER" \
--password "$PASSWORD" \
$EXTRAS \
--cpu-threads "$cpu_threads" \
--keepalive true

0 comments on commit aec4c04

Please sign in to comment.