Commit e41ff568 authored by sokai's avatar sokai

cron setup corrected (fixed by Sven)

parent de2933e1
......@@ -21,7 +21,7 @@ EXTRA_COMMANDS="status update upgrade"
SCRIPTVERSION='160125-bf'
SCRIPT=${SCRIPTPATH}${SCRIPTNAME}
CRONTAB='/var/spool/cron/crontabs/root'
CRONINTERVAL=$(head -30 /dev/urandom | tr -dc "0123456789" | head -c2) # run cron hourly at a random minute
CRONINTERVAL=$(head -30 /dev/urandom | tr -dc "012345" | head -c2) # run cron hourly at a random minute
WIF=$(ifconfig | awk '/10\.22\.[0-9]{1,3}\.[0-9]{1,3}/ {print $1}' RS="\n\n" | grep -m 1 wlan) # http://stackoverflow.com/a/18344694/338049
#WIF= uci show = [email protected][0].ifname=wlan0-adhoc-2
......@@ -47,7 +47,7 @@ SYSTEMTYPE=$(grep 'system type' /proc/cpuinfo|awk '{$1=$2=""; print}'| sed 's/
start() {
if ! $(grep -q ${SCRIPT} ${CRONTAB}); then
CRONJOB="*/${CRONINTERVAL} * * * * ${SCRIPT} update # FFP Access Points DataBase"
CRONJOB="${CRONINTERVAL} * * * * ${SCRIPT} update # FFP Access Points DataBase"
echo "${CRONJOB}" >> ${CRONTAB}
echo "root" > /var/spool/cron/crontabs/cron.update # reload crontab
logger -t ${SCRIPTNAME} "cron job added (${SCRIPT} start)"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment