fix: create clash_provide_config file and update subscription settings
- Improved comments in settings.ini for better clarity on renew behavior and subscription URL usage.
This commit is contained in:
@@ -391,6 +391,9 @@ upsubs() {
|
||||
log Debug "Downloading ${update_file_name}"
|
||||
if upfile "${update_file_name}" "${subscription_url_clash}"; then
|
||||
log Info "${update_file_name} saved"
|
||||
# Make sure the folder exists
|
||||
mkdir -p "$(dirname "$clash_provide_config")"
|
||||
touch "$clash_provide_config"
|
||||
# If there is a yq command, extract the proxy information from the yml and output it to the clash_provide_config file
|
||||
if [ "${enhanced}" = "true" ]; then
|
||||
if ${yq} 'has("proxies")' "${update_file_name}" | grep -q "true"; then
|
||||
|
||||
@@ -74,12 +74,12 @@ run_crontab="false"
|
||||
# Type "su -c /data/adb/box/scripts/box.tool geox" to update geox
|
||||
update_geo="false"
|
||||
|
||||
# If "renew=true" it will update config.yaml not the subscription configuration. Type "su -c /data/adb/box/scripts/box.tool subs" to update subscription
|
||||
renew=false
|
||||
# If "renew=true", it will update $name_clash_config; if false, it will only retrieve proxies: [] for proxy-providers: [].
|
||||
# Type "su -c /data/adb/box/scripts/box.tool subs" to update subscription
|
||||
renew="true"
|
||||
update_subscription="false"
|
||||
|
||||
# Example: clash subscription URL
|
||||
subscription_url_clash='https://proxy-list.cloudaccess.host/vless/api?cc=ID,US,JP,SG&cdn=true&tls=true&limit=10&format=clash' # This is just an example.
|
||||
# Source subscription URL for Clash configuration
|
||||
subscription_url_clash='http://127.0.0.1:12345/api/file/clash.yaml'
|
||||
|
||||
# Clash configuration
|
||||
name_clash_config="config.yaml"
|
||||
@@ -90,6 +90,7 @@ name_provide_clash_config="subscription.yaml"
|
||||
clash_provide_config="${box_dir}/clash/provide/${name_provide_clash_config}"
|
||||
|
||||
# Support rules specified in subscriptions. This is useful when the subscription contains customized rules as well.
|
||||
# It will fetch rules: [] from the $subscription_url_clash configuration and add them to $name_clash_config; this has no effect if renew=true.
|
||||
custom_rules_subs="false"
|
||||
name_provide_clash_rules="rules.yaml"
|
||||
clash_provide_rules="${box_dir}/clash/provide/${name_provide_clash_rules}"
|
||||
|
||||
Reference in New Issue
Block a user