contrib/package: Add update script for freifunkmap
[project/luci.git] / contrib / package / freifunk-mapupdate / root / etc / uci-defaults / freifunk-mapupdate
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 (file)
index 0000000..dee7f1b
--- /dev/null
@@ -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