Author

Topic: bitcoin+truecrypt: tiny run-script to make using tc'd wallets easier (Read 818 times)

newbie
Activity: 16
Merit: 0
#!/bin/bash
<bitcoin+truecrypt: tiny run-script to make using tc'd wallets easier

this script checks to make sure a specific wallet file exists before running bitcoin

this might be desirable if one is opening a wallet from a truecrypt drive, and wants to ensure the wallet exists and is writeable before opening the client

I found it useful because I kept accidentally opening up the client w/o mounting the tc drive. Also, my wallet permissions changed yielding qt start errors which took me a while to figure out whilst I was deleting database/blockchain files erroneously. Since I will likely forget about the cause of the error sometime in the future, this script will remind me for quick truecrypt wallet re-accessing.

To use just change the paths below to match up with your truecrypt wallet location and bitcoin-qt client path.

-xris on bitcoin forum

COMMENTSES
walletFile="/media/truecrypt1/btc_wallet/wallet.dat";
bitcoinClient="/home/x/bitcoin-0.8.1-linux/bin/64/bitcoin-qt"

echo "checking to see if wallet exists and is writeable...";
if [ -f $walletFile ]
then
   echo "found the wallet file"
   if [ -w $walletFile ]
   then
      echo "wallet file is writeable"
      echo "looking for bitcoin client..."
      if [ -f $bitcoinClient ]
      then
         echo "found bitcoin client...opening it now..."
         $bitcoinClient
         echo "closing client"
      else echo "could not find the bitcoin client! check the app path and then re-run this script"
      fi
   else echo "wallet file is NOT writeable so will not open bitcoin! change its permissions and then re-run this script"
   fi
else
   echo "didn't find the wallet file at $walletFile!"
fi
echo "ending script..."
sleep 30
Jump to: