adjust: crontab geo / sub

This commit is contained in:
taamarin
2023-06-08 16:50:19 +07:00
parent d55c8290b0
commit 66ebd0ebe3
3 changed files with 10 additions and 8 deletions

View File

@@ -20,14 +20,14 @@ delete_logs() {
find "${run_path}" -type f -name "*.log" -mtime +2 -exec rm -f {} \; || log warn "Error deleting old logs"
}
crontab_geo() {
crontab_geosub() {
if [[ "${auto_update_geox}" != "false" || "${auto_update_subscription}" != "false" ]]; then
echo "${update_interval_geox} ${scripts_dir}/box.tool geox" >> "${run_path}/root"
echo "${update_interval_subs} ${scripts_dir}/box.tool subs" >> "${run_path}/root"
log debug "Interval crontab geox (${update_interval_geox})."
log debug "Interval crontab subscription (${update_interval_subs})."
log debug "${bin_name} geox (${auto_update_geox})."
if [ "${bin_name}" = "clash" ]; then
echo "${update_interval_subs} ${scripts_dir}/box.tool subs" >> "${run_path}/root"
log debug "Interval crontab subscription (${update_interval_subs})."
log debug "${bin_name} subscription (${auto_update_subscription})."
fi
else
@@ -410,8 +410,8 @@ crontab_alive() {
"xray"|"sing-box"|"v2ray") log info "config '${data_dir}/${bin_name}/*.json'";;
*) log error "${bin_name}: <unknown>"; exit 1;;
esac
# Executes the crontab_geo function
crontab_geo
# Executes the crontab_geosub function
crontab_geosub
}
start_box() {

View File

@@ -13,7 +13,7 @@ dev=true
singbox_releases=false
# whether use ghproxy to accelerate github download
use_ghproxy=false
use_ghproxy=true
# Check internet connection with mlbox
check_connection_with_mlbox() {

View File

@@ -44,8 +44,10 @@ ignore_out_list=()
# Update subscription & geox
# Set update interval using cron, for more information: https://crontab.guru/
# Type "su -c /data/adb/box/scripts/box.tool geox" to update geox
# set 'true' to enable Cron job
crontab_sec="false"
# Type "su -c /data/adb/box/scripts/box.tool geox" to update geox
update_interval_geox="0 12 */3 * *" # updates will run at 12 noon every three days.
auto_update_geox="true"
@@ -78,7 +80,7 @@ clash_domestic_config="${data_dir}/clash/provide/domestic.yml"
# Setting DNS variables, DNS documentation is at https://adguard-dns.io/kb/general/dns-providers/.
# The intervaldns variable must be in cron format. For example "*/10 * * * *" to run it every 10 minutes.
# If there are no schedules to set, intervaldns must be left blank.
intervaldns="*/10 * * * *"
intervaldns=""
static_dns1="94.140.14.14"
static_dns2="2a10:50c0::ad1:ff"