Skip to content

Instantly share code, notes, and snippets.

@farfanoide
Last active January 5, 2018 23:55
Show Gist options
  • Save farfanoide/51419020184bdd3f97dc30002dc31a4e to your computer and use it in GitHub Desktop.
Save farfanoide/51419020184bdd3f97dc30002dc31a4e to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
[ ! $# -eq 2 ] && echo need user and worker name && exit 1
user_name=$1
node_name=$2
wget http://www.coinmagi.org/files/m-cpuminer/m-minerd-linux.tar.gz
tar -xzf m-minerd-linux.tar.gz
cat << EOF > /lib/systemd/system/magicoind.service
# cat << EOF > /tmp/magicoind
[Unit]
Description=MagiCoin service
After=network.target
[Service]
Type=simple
ExecStart=/root/m-minerd-linux/64/m-minerd -o stratum+tcp://mining.m-hash.com:3334 -u ${user_name}.${node_name} -p ${node_name} -e 60
WorkingDirectory=/root/m-minerd-linux/64
RestartSec=10
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
systemctl enable magicoind.service
systemctl daemon-reload
systemctl start magicoind.service
apt-get update\
&& apt-get install -y htop bmon vim tmux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment