Fix crontab task creation
This commit is contained in:
parent
e7beaa2244
commit
f421ee63ba
@ -52,16 +52,14 @@ reload_service() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setcron() {
|
setcron() {
|
||||||
touch $CRON_FILE
|
sed -i '/mosupdater.sh/d' $CRON_FILE 2>/dev/null
|
||||||
sed -i '/mosupdater.sh/d' $CRON_FILE 2>/dev/null && {
|
|
||||||
[ "$(uci -q get mosdns.mosdns.geo_auto_update)" -eq 1 ] && echo "0 $(uci -q get mosdns.mosdns.geo_update_day_time) * * $(uci -q get mosdns.mosdns.geo_update_week_time) /etc/mosdns/mosupdater.sh" >>$CRON_FILE
|
[ "$(uci -q get mosdns.mosdns.geo_auto_update)" -eq 1 ] && echo "0 $(uci -q get mosdns.mosdns.geo_update_day_time) * * $(uci -q get mosdns.mosdns.geo_update_week_time) /etc/mosdns/mosupdater.sh" >>$CRON_FILE
|
||||||
}
|
|
||||||
crontab $CRON_FILE
|
crontab $CRON_FILE
|
||||||
}
|
}
|
||||||
|
|
||||||
delcron() {
|
delcron() {
|
||||||
sed -i '/mosupdater.sh/d' $CRON_FILE 2>/dev/null
|
sed -i '/mosupdater.sh/d' $CRON_FILE 2>/dev/null
|
||||||
/etc/init.d/cron restart
|
crontab $CRON_FILE
|
||||||
}
|
}
|
||||||
|
|
||||||
adblock() {
|
adblock() {
|
||||||
|
Loading…
Reference in New Issue
Block a user