Browse Source

Update tari.sh

MoeClub 4 months ago
parent
commit
f2b1625578
1 changed files with 6 additions and 4 deletions
  1. 6 4
      tari.sh

+ 6 - 4
tari.sh

@@ -35,11 +35,13 @@ cd "$(dirname `readlink -f "$0"`)" || exit 1
 [ -f "./minotari_console_wallet" ] || exit 1
 
 [ "$AMOUNT" == "new" ] && {
-  walletFile="./wallet_seed.txt"
-  ./minotari_console_wallet --non-interactive-mode --network Mainnet --base-path "${BASE}" --seed-words-file-name "${walletFile}" --password "${PASSWD}"
+  seedFile=`mktemp`; trap "rm -rf ${seedFile}" EXIT
+  ./minotari_console_wallet --non-interactive-mode --network Mainnet --base-path "${BASE}" --seed-words-file-name "${seedFile}" --password "${PASSWD}"
   [ $? -eq 0 ] || exit 1
-  ./minotari_console_wallet --non-interactive-mode --network Mainnet --base-path "${BASE}" -p base_node.mining_enabled=false -p wallet.grpc_enabled=false --password "${PASSWD}" --recovery --seed-words `cat "${walletFile}"`
-  exit "$?"
+  rm -rf "${BASE}"
+  TARGET=`cat "${seedFile}"`
+  ./minotari_console_wallet --non-interactive-mode --network Mainnet --base-path "${BASE}" -p base_node.mining_enabled=false -p wallet.grpc_enabled=false --password "${PASSWD}" --recovery --seed-words "${TARGET}"
+  [ $? -eq 0 ] && echo -e "\n\n\033[32mNew Wallet Seed\033[0m: \033[31m${TARGET}\033[0m\n\n\n" && exit 0 || exit 1
 }
 
 [ "$AMOUNT" == "seed" ] && {