luci/contrib/package/freifunk-mapupdate/root/etc/uci-defaults/50_freifunk-mapupdate
Jo-Philipp Wich 8eaac4b637 Use numeric prefixes for uci-defaults scripts
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2016-01-27 16:50:19 +01:00

6 lines
332 B
Bash

#!/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