summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/freifunk-mapupdate/root/etc/uci-defaults
diff options
context:
space:
mode:
authorManuel Munz <freifunk@somakoma.de>2011-09-24 20:15:26 +0000
committerManuel Munz <freifunk@somakoma.de>2011-09-24 20:15:26 +0000
commit42a129f669159eee467e1198bcd84f38257d14d3 (patch)
treee783ad1e13230cf12e8e3305974f4e75d4e63f0d /contrib/package/freifunk-mapupdate/root/etc/uci-defaults
parentbf49f78599a006a9d136d9fd83cecc5d8a5afb1a (diff)
contrib/package: Add update script for freifunkmap
Diffstat (limited to 'contrib/package/freifunk-mapupdate/root/etc/uci-defaults')
-rw-r--r--contrib/package/freifunk-mapupdate/root/etc/uci-defaults/freifunk-mapupdate6
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/package/freifunk-mapupdate/root/etc/uci-defaults/freifunk-mapupdate b/contrib/package/freifunk-mapupdate/root/etc/uci-defaults/freifunk-mapupdate
new file mode 100644
index 0000000000..dee7f1bb58
--- /dev/null
+++ b/contrib/package/freifunk-mapupdate/root/etc/uci-defaults/freifunk-mapupdate
@@ -0,0 +1,6 @@
+#!/bin/sh
+test -f /etc/crontabs/root || touch /etc/crontabs/root
+SEED="$( dd if=/dev/urandom bs=2 count=1 2>&- | hexdump | if read line; then echo 0x${line#* }; fi )"
+MIN="$(( $SEED % 59 ))"
+grep -q "ff_mapupdate.sh" /etc/crontabs/root || echo "$MIN * * * * /usr/sbin/ff_mapupdate.sh" >> /etc/crontabs/root
+/etc/init.d/cron restart