You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
540 B
27 lines
540 B
#!/bin/bash
|
|
# Fetch the keys
|
|
Radd=$(./printkey.py Radd)
|
|
privkey=$(./printkey.py wif)
|
|
if [[ $1 = "KMD" ]]; then
|
|
chain="komodo-cli"
|
|
else
|
|
chain="komodo-cli -ac_name=$1"
|
|
fi
|
|
|
|
# Wait for the deamon to actually start
|
|
started=0
|
|
while [[ ${started} -eq 0 ]]; do
|
|
sleep 1
|
|
validateaddress=$($chain validateaddress $Radd 2> /dev/null)
|
|
outcome=$(echo $?)
|
|
if [[ ${outcome} -eq 0 ]]; then
|
|
started=1
|
|
fi
|
|
done
|
|
|
|
mine=$(echo $validateaddress | jq -r .ismine)
|
|
if [[ $mine = "false" ]]; then
|
|
$chain importprivkey $privkey
|
|
else
|
|
echo $Radd
|
|
fi
|
|
|