Skip to content

Instantly share code, notes, and snippets.

@motivic
Last active December 30, 2017 20:03
Show Gist options
  • Select an option

  • Save motivic/384584df15f1da86fe186553aa8b65a7 to your computer and use it in GitHub Desktop.

Select an option

Save motivic/384584df15f1da86fe186553aa8b65a7 to your computer and use it in GitHub Desktop.
ethminer start/stop shell script for crontab
#!/usr/bin/env bash
# Inspired by https://forum.ethereum.org/discussion/13723/cron-the-miner
ethminer=/opt/ethminer
wallet=08adb68e47e6552f23a5d34feb0d7b47852522b6
log="$HOME/log/ethminer_$(date "+%Y%m%d_%H%M%S").log"
case $1 in
start)
$ethminer --farm-recheck 200 --cuda --stratum us1.ethermine.org:4444 -SF us1.ethermine.org:14444 --userpass $wallet > $log 2>&1 &
;;
stop)
ethminer_pid=$(ps axf | grep ethminer | grep -v grep | awk '{print $1}')
kill -9 $ethminer_pid
;;
*)
echo "wrong parameter"
exit 2
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment