only start crond if there are files in the crontab
[openwrt-10.03/.git] / package / busybox / files / cron
index e78d02332cd3881d06ae6d905793709123e0f286..9a313927178067409d5c729dce84922f8b24c2b0 100755 (executable)
@@ -1,12 +1,14 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2006 OpenWrt.org
+START=50
 
 start () {
+       [ -z $(ls /etc/crontabs/) ] && exit 1
        mkdir -p /var/spool/cron
        [ -L /var/spool/cron/crontabs ] || ln -s /etc/crontabs /var/spool/cron/crontabs
        crond -c /etc/crontabs
 }
 
 stop() {
-       killall crond
+       killall -9 crond
 }