diff --git a/home.admin/config.scripts/network.wallet.sh b/home.admin/config.scripts/network.wallet.sh index 23331a1b5..7511c4a5a 100644 --- a/home.admin/config.scripts/network.wallet.sh +++ b/home.admin/config.scripts/network.wallet.sh @@ -36,9 +36,11 @@ fi ################### if [ "$1" = "1" ] || [ "$1" = "on" ]; then - if ! grep -Eq "^wallet=wallet.dat" /mnt/hdd/${network}/${network}.conf; then - echo "Enable the multiwallet feature in ${network} core and specify wallet.dat" - echo "wallet=wallet.dat" | sudo tee -a /mnt/hdd/${network}/${network}.conf >/dev/null + # specify wallet.dat for mainnet to avoid error on testnet + sudo sed -i "s/^wallet=wallet.dat/main.wallet=wallet.dat/g" /mnt/hdd/${network}/${network}.conf + if ! grep -Eq "^${chain}.wallet=wallet.dat" /mnt/hdd/${network}/${network}.conf; then + echo "Enable the multiwallet feature in ${network} core ${chain}net and specify wallet.dat" + echo "${chain}.wallet=wallet.dat" | sudo tee -a /mnt/hdd/${network}/${network}.conf >/dev/null restartService=1 else echo "Multiwallet is active and wallet.dat is used."