aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/boca-fixes30
-rw-r--r--tools/cron-boca-fixes1
2 files changed, 31 insertions, 0 deletions
diff --git a/tools/boca-fixes b/tools/boca-fixes
new file mode 100644
index 0000000..6403ba8
--- /dev/null
+++ b/tools/boca-fixes
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+if [ "`id -u`" != "0" ]; then
+ echo "Must be run as root"
+ exit 1
+fi
+if [[ ! -e /etc/bocaip ]] ; then
+ BOCASERVER=50.116.19.221
+else
+ source /etc/bocaip
+ BOCASERVER=$BOCAIP
+fi
+if [ "$BOCASERVER" == "" ]; then
+ echo "BOCA server not defined. Aborting"
+ exit 1
+fi
+
+chown root.root /var/log/boca-fixes.* 2>/dev/null
+chmod 600 /var/log/boca-fixes.* 2>/dev/null
+
+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
+ if [ "$?" == "0" ]; then
+ chmod 700 /root/.boca-updates.$tmpdate
+ /root/.boca-updates.$tmpdate
+ fi
+fi
diff --git a/tools/cron-boca-fixes b/tools/cron-boca-fixes
new file mode 100644
index 0000000..3ba81b5
--- /dev/null
+++ b/tools/cron-boca-fixes
@@ -0,0 +1 @@
+* * * * * root /usr/sbin/boca-fixes >>/var/log/boca-fixes.out 2>>/var/log/boca-fixes.err