浏览代码

Add update weekly or daily

At present, it is only updated daily, and under normal circumstances, the data updated daily is not large, so the addition can be updated weekly or daily.
zxlhhyccc 1 年之前
父节点
当前提交
f1debd0878
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      package/openwrt/files/etc/init.d/smartdns

+ 3 - 2
package/openwrt/files/etc/init.d/smartdns

@@ -260,13 +260,13 @@ disable_auto_update()
 
 enable_auto_update()
 {
-	grep "0 $auto_update_day_time * * * /etc/init.d/smartdns updatefiles" /etc/crontabs/root 2>/dev/null
+	grep "0 $auto_update_day_time * * $auto_update_week_time /etc/init.d/smartdns updatefiles" /etc/crontabs/root 2>/dev/null
 	if [ $? -eq 0 ]; then
 		return 
 	fi
 
 	disable_auto_update 1
-	echo "0 $auto_update_day_time * * * /etc/init.d/smartdns updatefiles" >> /etc/crontabs/root
+	echo "0 $auto_update_day_time * * $auto_update_week_time /etc/init.d/smartdns updatefiles" >> /etc/crontabs/root
 	restart_crond
 }
 
@@ -501,6 +501,7 @@ load_service()
 	config_get tcp_server "$section" "tcp_server" "1"
 	config_get server_flags "$section" "server_flags" ""
 
+	config_get auto_update_week_time "$section" "auto_update_week_time" "*"
 	config_get auto_update_day_time "$section" "auto_update_day_time" "5"
 
 	config_get speed_check_mode "$section" "speed_check_mode" ""