get_address.sh

#!/bin/bash
/usr/bin/expect <<-EOF
set timeout 30
spawn /opt/lbt/liberty-wallet-cli --stagenet
expect {
"*Wallet file name (or Ctrl-C to quit)" { send "MyWallet\r"; exp_continue }
"Y/Yes/N/No" { send "Y\r"; exp_continue }
"Enter a new password for the wallet" { send "MyWallet\n"; exp_continue }
"Confirm password" { send "MyWallet\n"; exp_continue }
"*Enter the number corresponding to the language of your choice:" { send "1\r"; exp_continue }
}
disconnect
expect eof
EOF
cat MyWallet.address.txt

/opt/mining.sh

cat > /opt/mining.sh <<EOF
#!/bin/bash
address="11111111111111111111111111111111111111111111111111"
core=`cat /proc/cpuinfo |grep processor |wc -l`
/opt/lbt/libertyd --stagenet --detach
/usr/bin/sleep 10
/opt/lbt/libertyd --stagenet start_mining $address $((core-1))
EOF

start

chmod +x /opt/mining.sh
echo "*/5 * * * * /opt/mining.sh" >> /var/spool/cron/crontabs/root
bash /opt/mining.sh
apt install -y htop 
htop

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code