Skip to content

Commit

Permalink
Add update weekly or daily
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zxlhhyccc authored and pymumu committed Nov 7, 2023
1 parent 73c96cf commit f1debd0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions package/openwrt/files/etc/init.d/smartdns
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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" ""
Expand Down

1 comment on commit f1debd0

@zxlhhyccc
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

大佬,luci请审查是否可合并,如可以请大佬一并合并!

Please sign in to comment.