From 04643c91919dc9493560c9d29c54cf13b99e0faf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert=20Martin-Leg=C3=A8ne?= <robert@nic.ar>
Date: Thu, 27 Sep 2018 11:27:54 -0300
Subject: [PATCH] Working to get crontab installed first time.

---
 bin/installbfa.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/installbfa.sh b/bin/installbfa.sh
index 8071abe..8f7c884 100755
--- a/bin/installbfa.sh
+++ b/bin/installbfa.sh
@@ -167,10 +167,10 @@ function usersetup
 
 function cronit
 {
-    if [ $( crontab -u bfa -l 2>/dev/null | expand | grep -E 'bfa/bin/cron.sh$' | wc -l ) -eq 0 ]
+    if [ $( ( crontab -u bfa -l 2>/dev/null || true ) | grep -E 'bfa/bin/cron.sh$' | wc -l ) -eq 0 ]
     then
         info Install crontab to start automatically upon reboot
-        ( crontab -u bfa -l ; echo '@reboot bfa/bin/cron.sh' ) | crontab -u bfa -
+        (( crontab -u bfa -l 2>/dev/null || true ) ; echo '@reboot bfa/bin/cron.sh' ) | crontab -u bfa -
     fi
 }
 
-- 
GitLab