From d4ed2b2b3e24fe23e7619795e57ae2363a04e150 Mon Sep 17 00:00:00 2001 From: Ola Date: Mon, 3 Aug 2020 16:51:10 +0200 Subject: [PATCH 1/2] logic inverted and remove wallet folder on cancellation --- scripts/cnode-helper-scripts/itnRewards.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/cnode-helper-scripts/itnRewards.sh b/scripts/cnode-helper-scripts/itnRewards.sh index a3bae682d..997f04ce4 100755 --- a/scripts/cnode-helper-scripts/itnRewards.sh +++ b/scripts/cnode-helper-scripts/itnRewards.sh @@ -36,14 +36,14 @@ if [[ ! -d "${WALLET_FOLDER}/${wallet_name}" ]]; then fi if [[ $(cat "${itn_signing_key_file}") == ed25519e_* ]]; then - if ${CCLI} shelley key 2>&1 | grep -q "convert-itn-extended-key"; then + if ! ${CCLI} shelley key 2>&1 | grep -q "convert-itn-extended-key"; then echo -e "\n${ORANGE}WARNING${NC}: cardano-cli lacks support for extended ITN key conversion: ${CCLI}\n" echo -e "If a special version of cardano-cli is built with this support, please specify path below, else follow instructions available at:" echo -e " https://cardano-community.github.io/guild-operators/#/Scripts/itnrewards\n" while true; do read -r -p "Enter path to cardano-cli with support for extended key conversion or press enter to quit: " CCLI - [[ -z "${CCLI}" ]] && exit 1 - if ${CCLI} shelley key 2>&1 | grep -q "convert-itn-extended-key"; then + [[ -z "${CCLI}" ]] && rm -rf "${WALLET_FOLDER}/${wallet_name}" && exit 1 + if ! ${CCLI} shelley key 2>&1 | grep -q "convert-itn-extended-key"; then echo -e "\n${ORANGE}ERROR${NC}: specified file lacks support for extended ITN key conversion, please try again\n" continue fi From 195e507e48e9a98b6e8c620d82fe2679a4772a3b Mon Sep 17 00:00:00 2001 From: Ola Date: Mon, 3 Aug 2020 16:54:43 +0200 Subject: [PATCH 2/2] SC2115 fix --- scripts/cnode-helper-scripts/itnRewards.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cnode-helper-scripts/itnRewards.sh b/scripts/cnode-helper-scripts/itnRewards.sh index 997f04ce4..34cd189fb 100755 --- a/scripts/cnode-helper-scripts/itnRewards.sh +++ b/scripts/cnode-helper-scripts/itnRewards.sh @@ -42,7 +42,7 @@ if [[ $(cat "${itn_signing_key_file}") == ed25519e_* ]]; then echo -e " https://cardano-community.github.io/guild-operators/#/Scripts/itnrewards\n" while true; do read -r -p "Enter path to cardano-cli with support for extended key conversion or press enter to quit: " CCLI - [[ -z "${CCLI}" ]] && rm -rf "${WALLET_FOLDER}/${wallet_name}" && exit 1 + [[ -z "${CCLI}" ]] && rm -rf "${WALLET_FOLDER:?}/${wallet_name}" && exit 1 if ! ${CCLI} shelley key 2>&1 | grep -q "convert-itn-extended-key"; then echo -e "\n${ORANGE}ERROR${NC}: specified file lacks support for extended ITN key conversion, please try again\n" continue