Skip to content

Instantly share code, notes, and snippets.

@soediro
Last active May 7, 2018 19:50
bash script to run xmr-stak-cpu.
#!/usr/local/bin/bash
# Author: Sudiro
# Create related symbolic link to your "xmr-stak-cpu" binary and "/etc/config.conf" file or adapt your own params accordingly.
##############################################################################################################################
case "$1" in
start)
xmr-stak-cpu /etc/config.conf &
echo $!>/var/run/xmr-stak-cpu.pid
;;
stop)
kill `cat /var/run/xmr-stak-cpu.pid`
rm /var/run/xmr-stak-cpu.pid
;;
restart)
$0 stop
$0 start
;;
status)
if [ -e /var/run/xmr-stak-cpu.pid ]; then
echo xmr-stak-cpu is running, pid=`cat /var/run/xmr-stak-cpu.pid`
else
echo xmr-stak-cpu is NOT running
exit 1
fi
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment