Post
Topic
Board Hardware
Re: GekkoScience NewPac Stickminer Official Support Thread
by
Cohenpol
on 07/12/2019, 17:27:26 UTC
Save this code as mine.sh, edit the line starting with lxterminal with the full path to your cgminer folder and then put in the commands you usually use for your pool, mark as an executing program and run. It goes in a loop so to exit, just use control C...

Code:
#!/bin/sh
echo "Restarting cgminer every 6 hours"
while true
do
 lxterminal -e "/home/USERNAME/cgminer/cgminer -o POOL_URL -u USER -p PW --suggest-diff 128"
 sleep 21600
 pkill -f cgminer
 echo "Restarting cgminer..."
 sleep 4
done

Hi zsmith and all

When you say "save this code as mine.sh" , do you mean opening a text file then saving it as mine.sh in my cgminer folder? e.g. /home/pi/git/vtoang/cgminer/mine.sh?

Can I run a similar file for more instances such as mine2.sh and mine3.sh?  I run more than one instance for different R606' and Newpac's.

What would be the script to reboot the Pi4 weekly (e.g. 0100hrs every Monday) then to reboot each cgminer .sh file every 24hrs?

Does running the auto-reboot script commence from executing the .sh file and how would that conflict with the Pi4 reboot timing per week?

Would sleep 86400 = 24hrs?

Whats the sleep 4 at the end for?

Thank you in advance from a novice although I've loved this project build.  I can see the end in sight and all I need is to programme the Pi4's and miners to refresh on command Smiley