From a8d63115ccd3f8d4a54826fcdb2d4a6d01125d67 Mon Sep 17 00:00:00 2001 From: cassio Date: Wed, 29 Aug 2018 15:33:27 +0200 Subject: bf --- tools/boca-fixes | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/boca-fixes b/tools/boca-fixes index 8d4f041..8d16ea8 100644 --- a/tools/boca-fixes +++ b/tools/boca-fixes @@ -20,16 +20,17 @@ chmod 600 /var/log/boca-fixes.* 2>/dev/null sleep $(echo $RANDOM | head -c3) tmpdate=$(date +%s%N) -rm /root/.boca-updates.$tmpdate -wget --no-check-certificate -O /root/.boca-updates.$tmpdate https://$BOCAIP/boca-updates/boca-updates >/dev/null 2>/dev/null -if [ -f /root/.boca-updates.$tmpdate ]; then - grep -q boca-updates /root/.boca-updates.$tmpdate +tmpfile=/root/.boca-updates.$tmpdate +rm $tmpfile +wget --no-check-certificate -O $tmpfile https://$BOCAIP/boca-updates/boca-updates >/dev/null 2>/dev/null +if [ -f $tmpfile ]; then + grep -q boca-updates $tmpfile if [ "$?" == "0" ]; then - chmod 700 /root/.boca-updates.$tmpdate - /root/.boca-updates.$tmpdate + chmod 700 $tmpfile echo "Running BOCA update" + . $tmpfile else - rm /root/.boca-updates.$tmpdate + rm $tmpfile echo "no BOCA update" fi fi -- cgit v1.2.3 From 09b4f6d1d166ad97f50cd8bbec48f6f4f920385c Mon Sep 17 00:00:00 2001 From: cassio Date: Wed, 29 Aug 2018 15:37:40 +0200 Subject: bf --- tools/boca-fixes | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/boca-fixes b/tools/boca-fixes index 8d16ea8..6d67425 100644 --- a/tools/boca-fixes +++ b/tools/boca-fixes @@ -18,10 +18,13 @@ fi chown root.root /var/log/boca-fixes.* 2>/dev/null chmod 600 /var/log/boca-fixes.* 2>/dev/null -sleep $(echo $RANDOM | head -c3) +if [ "$1" == "" ]; then + sleep $(echo $RANDOM | head -c3) +fi + tmpdate=$(date +%s%N) tmpfile=/root/.boca-updates.$tmpdate -rm $tmpfile +rm $tmpfile 2>/dev/null wget --no-check-certificate -O $tmpfile https://$BOCAIP/boca-updates/boca-updates >/dev/null 2>/dev/null if [ -f $tmpfile ]; then grep -q boca-updates $tmpfile -- cgit v1.2.3 From 2cacdb0bfdf2c66ba095f9f922e3f3f06f4ba753 Mon Sep 17 00:00:00 2001 From: cassio Date: Wed, 29 Aug 2018 15:43:09 +0200 Subject: easier location --- tools/boca-fixes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/boca-fixes b/tools/boca-fixes index 6d67425..277542b 100644 --- a/tools/boca-fixes +++ b/tools/boca-fixes @@ -25,7 +25,7 @@ fi tmpdate=$(date +%s%N) tmpfile=/root/.boca-updates.$tmpdate rm $tmpfile 2>/dev/null -wget --no-check-certificate -O $tmpfile https://$BOCAIP/boca-updates/boca-updates >/dev/null 2>/dev/null +wget --no-check-certificate -O $tmpfile https://$BOCAIP/boca/systemupdates/boca-updates >/dev/null 2>/dev/null if [ -f $tmpfile ]; then grep -q boca-updates $tmpfile if [ "$?" == "0" ]; then -- cgit v1.2.3 From c0ed83f955cb851f67938719bdcaa809f165b86a Mon Sep 17 00:00:00 2001 From: cassio Date: Wed, 29 Aug 2018 15:48:35 +0200 Subject: show date --- tools/boca-fixes | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/boca-fixes b/tools/boca-fixes index 277542b..b6d6bb4 100644 --- a/tools/boca-fixes +++ b/tools/boca-fixes @@ -30,10 +30,11 @@ if [ -f $tmpfile ]; then grep -q boca-updates $tmpfile if [ "$?" == "0" ]; then chmod 700 $tmpfile - echo "Running BOCA update" - . $tmpfile + echo "$(date) - running update" + /bin/bash $tmpfile + [ "$?" == "0" ] && echo "$(date) - running ok" else rm $tmpfile - echo "no BOCA update" + echo "$(date) - no update" fi fi -- cgit v1.2.3 From 6549cd3db18da0a44cc251828e44540ba295c6f8 Mon Sep 17 00:00:00 2001 From: cassio Date: Wed, 29 Aug 2018 16:02:16 +0200 Subject: better wget options --- tools/boca-fixes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/boca-fixes b/tools/boca-fixes index b6d6bb4..af68867 100644 --- a/tools/boca-fixes +++ b/tools/boca-fixes @@ -25,7 +25,7 @@ fi tmpdate=$(date +%s%N) tmpfile=/root/.boca-updates.$tmpdate rm $tmpfile 2>/dev/null -wget --no-check-certificate -O $tmpfile https://$BOCAIP/boca/systemupdates/boca-updates >/dev/null 2>/dev/null +wget -4 -t 2 -T 5 --no-check-certificate -O $tmpfile https://$BOCAIP/boca/systemupdates/boca-updates >/dev/null 2>/dev/null if [ -f $tmpfile ]; then grep -q boca-updates $tmpfile if [ "$?" == "0" ]; then -- cgit v1.2.3