From 62171f2a4d30f2b6df64cca9345518f99dfb8724 Mon Sep 17 00:00:00 2001 From: zxlhhyccc <45259624+zxlhhyccc@users.noreply.github.com> Date: Wed, 11 Oct 2023 13:04:41 +0800 Subject: [PATCH] add choose update time --- package/openwrt/files/etc/init.d/smartdns | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package/openwrt/files/etc/init.d/smartdns b/package/openwrt/files/etc/init.d/smartdns index 28b5276c5f..afc4aa453a 100644 --- a/package/openwrt/files/etc/init.d/smartdns +++ b/package/openwrt/files/etc/init.d/smartdns @@ -260,13 +260,13 @@ disable_auto_update() enable_auto_update() { - grep "0 5 * * * /etc/init.d/smartdns updatefiles" /etc/crontabs/root 2>/dev/null + grep "0 $auto_update_day_time * * * /etc/init.d/smartdns updatefiles" /etc/crontabs/root 2>/dev/null if [ $? -eq 0 ]; then return fi disable_auto_update 1 - echo "0 5 * * * /etc/init.d/smartdns updatefiles" >> /etc/crontabs/root + echo "0 $auto_update_day_time * * * /etc/init.d/smartdns updatefiles" >> /etc/crontabs/root restart_crond } @@ -498,6 +498,8 @@ load_service() config_get tcp_server "$section" "tcp_server" "1" config_get server_flags "$section" "server_flags" "" + config_get auto_update_day_time "$section" "auto_update_day_time" "5" + config_get speed_check_mode "$section" "speed_check_mode" "" [ ! -z "$speed_check_mode" ] && conf_append "speed-check-mode" "$speed_check_mode"