you can do it by using blockchain.info and common bash tools that you already have in your system like wget, grep and awk, printf for formatting
For example by using (replace ADDRESS with the actual address you want to query):
wget -qO- blockchain.info/rawaddr/ADDRESS 2>&1 | grep -Po '"final_balance":\K[0-9]+'
And if you want to format the output ...
My thoughts, in no particular order:
Consider if you need a hot wallet at all. If you don't need to send funds, just accept them, you could probably use BIP32 to generate addresses. Downside is that this way is more complicated.
You should probably bail out of your script if bitcoin-cli produces any errors at all. If your Bitcoin node can't figure out its ...
Is bitcoin-cli available? If so, bitcoin-cli stop instead of pkill $BITCOIND_PID.
My own preference is to add sleep 2 following a stop, as I've experienced issues immediately restarting the stopped daemon where it behaves like a child thread hasn't finished cleaning up before the parent exits. That may not be what's happening - I've not investigated that ...
You need to use the decode flag -d:
printf "5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ" | base58 -c -d | xxd -p
To have xxd output all on one line, give it a large column number -c flag:
$ printf "5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ" | base58 -c -d | xxd -p -c ...
If this is your echo output:
Then you have too many quotes. When you run echo, you should see:
That's because the shell strips off the outer set of quotes; it does ...