From de4c1faef6f05cc35f0f35b826565c034020f9be Mon Sep 17 00:00:00 2001 From: urban Date: Thu, 31 Aug 2023 22:45:14 +0200 Subject: [PATCH] add shortcut --- Scripts/create_configuration.sh | 48 ++++++++++++++++++--------------- shuriken.sh | 21 +++++++++++++++ 2 files changed, 48 insertions(+), 21 deletions(-) create mode 100755 shuriken.sh diff --git a/Scripts/create_configuration.sh b/Scripts/create_configuration.sh index 4f3c634..01c199f 100755 --- a/Scripts/create_configuration.sh +++ b/Scripts/create_configuration.sh @@ -2,25 +2,31 @@ source ./global.sh source ./utils.sh -msg logo.txt -p "We will create a new configuration" -msg wallet_suggestions.txt -echo "" -r "Your bitcoin address:" address -#python3 ../Tools/address_validation.py $address -echo "" -echo -e " \033[33m?\033[0m Which mining pool would you like to use?" -mining_pool=$(gum choose --cursor=  ›  public-pool.io solo.ckpool.org custom) -p_user $mining_pool -if [[ $mining_pool == "custom" ]]; then - r "Mining pool stratum URL:" $mining_pool -fi -echo "" -p "Creating worker.sh" -python3 ../Tools/create_worker.py $mining_pool $address > ../Worker/worker.sh -chmod +x ../Worker/worker.sh -echo "address: $address" > ../Worker/worker.conf -echo "pool: $mining_pool" >> ../Worker/worker.conf -p "Ready to boil the oceans captain!" -echo "" \ No newline at end of file +new_configuration(){ + msg logo.txt + p "We will create a new configuration" + msg wallet_suggestions.txt + echo "" + r "Your bitcoin address:" address + #python3 ../Tools/address_validation.py $address + echo "" + echo -e " \033[33m?\033[0m Which mining pool would you like to use?" + mining_pool=$(gum choose --cursor=  ›  public-pool.io solo.ckpool.org custom) + p_user $mining_pool + + if [[ $mining_pool == "custom" ]]; then + r "Mining pool stratum URL:" $mining_pool + fi + echo "" + p "Creating worker.sh" + python3 ../Tools/create_worker.py $mining_pool $address > ../Worker/worker.sh + chmod +x ../Worker/worker.sh + echo "address: $address" > ../Worker/worker.conf + echo "pool: $mining_pool" >> ../Worker/worker.conf + p "Ready to boil the oceans captain!" + p_ok "To start mining, use the command 'shuriken start'" + echo "" +} + +new_configuration \ No newline at end of file diff --git a/shuriken.sh b/shuriken.sh new file mode 100755 index 0000000..6af68ef --- /dev/null +++ b/shuriken.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +command=$1 +shift +cd ./Scripts + +if [[ $command == "stop" ]]; then + ./stop.sh $@ +fi +if [[ $command == "start" ]]; then + ./start.sh $@ +fi +if [[ $command == "run" ]]; then + ./start.sh $@ +fi +if [[ $command == "status" ]]; then + ./status.sh $@ +fi +if [[ $command == "config" ]]; then + ./create_configuration.sh $@ +fi \ No newline at end of file