Skip to content

Commit

Permalink
Multiple versions return different values, add a condition to skip se…
Browse files Browse the repository at this point in the history
…d depending on value of BASH_REMATCH
  • Loading branch information
rdlrt committed Oct 23, 2020
1 parent 2e2cf6a commit 76082c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/cnode-helper-scripts/gLiveView.sh
Expand Up @@ -146,7 +146,8 @@ if curl -s -m ${CURL_TIMEOUT} -o /tmp/gLiveView.sh "${URL}/gLiveView.sh" 2>/dev/
read -r -n 1 -s -p "" answer
if [[ "${answer}" = "u" ]]; then
if [[ $(grep "chmod.*._HOME" "${BASH_SOURCE[0]}") =~ ([^[{]+)_HOME ]]; then
sed -e "s@[C]NODE_HOME@${BASH_REMATCH[1]}_HOME@g" -i /tmp/gLiveView.sh
if [[ ${BASH_REMATCH[1]} != '"' ]] || ! [[ ${BASH_REMATCH[1]} =~ grep ]];then
sed -e "s@[C]NODE_HOME@${BASH_REMATCH[1]}_HOME@g" -i /tmp/gLiveView.sh
else
myExit 1 "${RED}Update failed!${NC}\n\nPlease use prereqs.sh or manually download to update gLiveView"
fi
Expand Down

0 comments on commit 76082c0

Please sign in to comment.