aboutsummaryrefslogtreecommitdiff
path: root/tools/boca-fixes
diff options
context:
space:
mode:
authorBruno Cesar Ribas <brunoribas@gmail.com>2018-08-29 14:05:35 +0000
committerBruno Cesar Ribas <brunoribas@gmail.com>2018-08-29 14:05:35 +0000
commit1e409a3208101c3cec585240e71e93418ba4fa30 (patch)
tree147d05d493b1d1b1c306ae361a22266d23566783 /tools/boca-fixes
parent535ecefb9189949e62d71062a1b668fe885f0fe0 (diff)
parent6549cd3db18da0a44cc251828e44540ba295c6f8 (diff)
downloadboca-1e409a3208101c3cec585240e71e93418ba4fa30.tar.gz
boca-1e409a3208101c3cec585240e71e93418ba4fa30.zip
Merge remote-tracking branch 'origin/develc' into devel
Diffstat (limited to 'tools/boca-fixes')
-rw-r--r--tools/boca-fixes25
1 files changed, 15 insertions, 10 deletions
diff --git a/tools/boca-fixes b/tools/boca-fixes
index 8d4f041..af68867 100644
--- a/tools/boca-fixes
+++ b/tools/boca-fixes
@@ -18,18 +18,23 @@ 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)
-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 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
- chmod 700 /root/.boca-updates.$tmpdate
- /root/.boca-updates.$tmpdate
- echo "Running BOCA update"
+ chmod 700 $tmpfile
+ echo "$(date) - running update"
+ /bin/bash $tmpfile
+ [ "$?" == "0" ] && echo "$(date) - running ok"
else
- rm /root/.boca-updates.$tmpdate
- echo "no BOCA update"
+ rm $tmpfile
+ echo "$(date) - no update"
fi
fi