From 993153ecfc0c78b8a743eb73b719bc480c6bf6fb Mon Sep 17 00:00:00 2001
From: Robert Martin-Legene <robert@nic.ar>
Date: Fri, 24 May 2019 21:16:31 -0300
Subject: [PATCH] Todavia faltaba "require"

---
 bin/installbfa.sh | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/bin/installbfa.sh b/bin/installbfa.sh
index 2092786..9d043a1 100755
--- a/bin/installbfa.sh
+++ b/bin/installbfa.sh
@@ -70,11 +70,15 @@ function web3install
         info "Initialising nodejs." &&
         runasownerof ~bfa npm init -y
     # nodejs package(s) that we need.
-    echo 'require("web3")' | runasownerof ~bfa nodejs 2>/dev/null && return
-    info "Installing nodejs module: web3 (will show many warnings)"
-    runasownerof ~bfa npm install web3
     info "Installing nodejs module: require"
     runasownerof ~bfa npm install require
+    if echo 'require("web3")' | runasownerof ~bfa nodejs 2>/dev/null
+    then
+        true
+    else
+    	info "Installing nodejs module: web3 (will show many warnings)"
+    	runasownerof ~bfa npm install web3
+    fi
 }
 
 function golanginstall
@@ -195,10 +199,10 @@ function userconfig
 
 function cronit
 {
-    if [ $( ( crontab -u bfa -l 2>/dev/null || true ) | grep -E "$BFAHOME/bin/cron.sh" | wc -l ) -eq 0 ]
+    if [ $( ( crontab -u bfa -l 2>/dev/null || true ) | grep -E "${BFAHOME#~/}/bin/cron.sh" | wc -l ) -eq 0 ]
     then
         info "Install crontab to start automatically upon reboot"
-        (( crontab -u bfa -l 2>/dev/null || true ) ; echo "@reboot $BFAHOME/bin/cron.sh" ) | crontab -u bfa -
+        (( crontab -u bfa -l 2>/dev/null || true ) ; echo "@reboot ${BFAHOME#~/}/bin/cron.sh" ) | crontab -u bfa -
     fi
 }
 
-- 
GitLab