Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
Makefile: Added background running and stop commands
Browse files Browse the repository at this point in the history
  • Loading branch information
gameofpointers committed Feb 13, 2023
1 parent 5cb1d35 commit a05ba89
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,29 @@ GO ?= latest
GORUN = env GO111MODULE=on go run

quai-cpu-miner:
go build -o ./build/bin/quai-cpu-miner main.go
go build -o ./build/bin/quai-cpu-miner main.go
@echo "Done building."
@echo "Run \"$(GOBIN)\" to launch quai-cpu-miner"
@echo "Run \"$(GOBIN)\" to launch quai-cpu-miner"

# to manually select a location to mine
run-mine:
./build/bin/quai-cpu-miner $(region) $(zone)

# to run in the background (manually set location)
run-mine-background:
ifeq (,$(wildcard logs))
mkdir logs
endif
@nohup ./build/bin/quai-cpu-miner $(region) $(zone) 1 >> logs/slice-$(region)-$(zone).log 2>&1 &

stop:
ifeq ($(shell uname -s),Darwin)
@if pgrep quai-cpu-miner; then pkill -f ./build/bin/quai-cpu-miner; fi
@while pgrep quai-cpu-miner >/dev/null; do \
echo "Stopping all Quai Network CPU Miners, please wait until terminated."; \
sleep 3; \
done;
else
@echo "Stopping all Quai Network CPU Miners, please wait until terminated.";
@if pgrep quai-cpu-miner; then killall -w ./build/bin/quai-cpu-miner; fi
endif

0 comments on commit a05ba89

Please sign in to comment.