@@ -9,9 +9,6 @@ busybox_path="/data/adb/magisk/busybox"
99# IPV6
1010ipv6=$( grep " ipv6" /data/clash/template | ${busybox_path} awk -F ' : ' ' {print $2}' | head -1)
1111
12- # 0 is to start only clash, 1 is clash+mosdns
13- run_mode=" 0"
14-
1512# ID
1613pref_id=" 5000"
1714mark_id=" 233"
@@ -28,6 +25,8 @@ nat_kernel="false"
2825filter_local=" false"
2926monitor_local_ip=" true"
3027
28+ # 0 is to start only clash, 1 is clash+mosdns
29+ run_mode=" 0"
3130# SELECT META OR PREMIUM
3231use_premium=" false"
3332# DOWNLOAD LANGGANAN/CONFIG
@@ -56,47 +55,48 @@ Cgroup_memory_limit="20M"
5655Clash_bin_name=" clash"
5756Clash_data_dir=" /data/clash"
5857# DIRECTORY TEMPLATE
59- Clash_dns=" /data/clash/template"
60- # CMD
61- cmd_run=" /data/clash/run/cmdRunning"
58+ Clash_template=" $Clash_data_dir /template"
6259# DIRECTORY LOG/SERVICE
63- Clash_run_path=" /data/clash/run"
64- logs_service=" /data/clash/run/service.log"
65- CFM_logs_file=" /data/clash/run/run.logs"
66- CFM_logs_service=" /data/clash/run/service.log"
60+ Clash_run_path=" $Clash_data_dir /run"
61+ logs_service=" $Clash_run_path /service.log"
62+ CFM_logs_file=" $Clash_run_path /run.logs"
63+ # CMD
64+ cmd_run=" $Clash_run_path /cmdRunning"
6765# DIRECTORY PID
68- Clash_pid_file=" /data/clash/run /clash.pid"
66+ Clash_pid_file=" $Clash_run_path /clash.pid"
6967# DIRECTORY KERNEL CLASH
70- Clash_bin_path=" /data/clash/kernel/${Clash_bin_name} "
68+ Clash_bin=" $Clash_data_dir /kernel"
69+ Clash_lib=" $Clash_bin /lib"
70+ Clash_bin_path=" $Clash_bin /${Clash_bin_name} "
7171# LIB KERNEL
72- Clash_Premium=" /data/clash/kernel/lib /Clash.Premium"
73- Clash_Meta=" /data/clash/kernel/lib /Clash.Meta"
72+ Clash_Premium=" $Clash_lib /Clash.Premium"
73+ Clash_Meta=" $Clash_lib /Clash.Meta"
7474# DIRECTORY SCRIPTS
75- Clash_scripts_dir=" /data/clash /scripts"
75+ Clash_scripts_dir=" $Clash_data_dir /scripts"
7676
7777# CUSTOM CONFIG.YAML
7878use_config=" false"
7979if [ " ${use_config} " == " false" ]; then
80- Clash_config_file=" /data/clash /config.yaml"
80+ Clash_config_file=" $Clash_data_dir /config.yaml"
8181else
82- Clash_config_file=" /data/clash /${use_config} "
82+ Clash_config_file=" $Clash_data_dir /${use_config} "
8383fi
8484# TEMPORARY CONFIG.YAML
85- temporary_config_file=" /data/clash/run /config.yaml"
85+ temporary_config_file=" $Clash_run_path /config.yaml"
8686# DIRECTORY PACKAGE
87- appuid_file=" /data/clash/run /appuid.list"
88- filter_packages_file=" /data/clash /packages.list"
87+ appuid_file=" $Clash_run_path /appuid.list"
88+ filter_packages_file=" $Clash_data_dir /packages.list"
8989system_packages_file=" /data/system/packages.list"
9090
9191# MOSDNS
9292# moddns is a plug-in DNS forwarder. Users can splicing plug-ins as needed to customize their own DNS processing logic.
93- mosdns_data_dir=" /data/clash /mosdns"
94- mosdns_bin_path=" ${mosdns_data_dir} /mosdns"
93+ mosdns_data_dir=" $Clash_data_dir /mosdns"
94+ mosdns_bin_path=" $Clash_bin /mosdns"
9595mosdns_config_file=" ${mosdns_data_dir} /config.yaml"
9696
9797# AUTO UPDATE KERNEL
9898schedule_update_core=" false"
99- url_meta=" https://cdn.githubjs.cf/MetaCubeX /Clash.Meta/releases"
99+ url_meta=" https://cdn.githubjs.cf/taamarin /Clash.Meta/releases"
100100url_premium=" https://cdn.githubjs.cf/Dreamacro/clash/releases"
101101arm=$( uname -m)
102102if [ " ${use_premium} " == " false" ]; then
@@ -122,15 +122,15 @@ else
122122fi
123123# SETTING UPDATE GEOX
124124auto_updateGeoX=" true"
125- Clash_geodata_mode=$( grep " geodata-mode" ${Clash_dns } | ${busybox_path} awk -F ' : ' ' {print $2}' )
125+ Clash_geodata_mode=$( grep " geodata-mode" ${Clash_template } | ${busybox_path} awk -F ' : ' ' {print $2}' )
126126if [ " ${Clash_geodata_mode} " == " false" ]; then
127- Clash_GeoIP_file=" /data/clash /Country.mmdb"
127+ Clash_GeoIP_file=" $Clash_data_dir /Country.mmdb"
128128 GeoIP_dat_url=" https://cdn.githubjs.cf/Hackl0us/GeoIP2-CN/raw/release/Country.mmdb"
129129else
130- Clash_GeoIP_file=" /data/clash /GeoIP.dat"
130+ Clash_GeoIP_file=" $Clash_data_dir /GeoIP.dat"
131131 GeoIP_dat_url=" https://cdn.githubjs.cf/v2fly/geoip/releases/latest/download/geoip-only-cn-private.dat"
132132fi
133- Clash_GeoSite_file=" /data/clash /GeoSite.dat"
133+ Clash_GeoSite_file=" $Clash_data_dir /GeoSite.dat"
134134GeoSite_url=" https://cdn.githubjs.cf/taamarin/v2ray-rules-dat/raw/release/GeoSite.dat"
135135# CLASH PERMISSIONS
136136Clash_permissions=" 6755"
152152# GREP FILE/PORT
153153Clash_user=$( echo ${Clash_user_group} | ${busybox_path} awk -F ' :' ' {print $1}' )
154154Clash_group=$( echo ${Clash_user_group} | ${busybox_path} awk -F ' :' ' {print $2}' )
155- Clash_tproxy_port=$( grep " tproxy-port" ${Clash_dns } | ${busybox_path} awk -F ' : ' ' {print $2}' )
156- Clash_dns_port=$( grep " listen" ${Clash_dns } | ${busybox_path} awk -F ' :' ' {print $3}' )
157- Clash_tun_status=$( ${busybox_path} awk -F ' : ' ' /^tun: *$/{getline; print $2}' ${Clash_dns } )
158- Clash_auto_route=$( grep " auto-route" ${Clash_dns } | ${busybox_path} awk -F ' : ' ' {print $2}' )
159- Clash_auto_detect_interface=$( grep " auto-detect-interface" ${Clash_dns } | ${busybox_path} awk -F ' : ' ' {print $2}' )
160- Clash_tcp_concurrent=$( grep " tcp-concurrent" ${Clash_dns } | ${busybox_path} awk -F ' :' ' {print $2}' )
161- Clash_enhanced_mode=$( grep " enhanced-mode" ${Clash_dns } | ${busybox_path} awk -F ' : ' ' {print $2}' )
162- Clash_stack_mode=$( grep " stack" ${Clash_dns } | ${busybox_path} awk -F ' : ' ' {print $2}' )
155+ Clash_tproxy_port=$( grep " tproxy-port" ${Clash_template } | ${busybox_path} awk -F ' : ' ' {print $2}' )
156+ Clash_dns_port=$( grep " listen" ${Clash_template } | ${busybox_path} awk -F ' :' ' {print $3}' )
157+ Clash_tun_status=$( ${busybox_path} awk -F ' : ' ' /^tun: *$/{getline; print $2}' ${Clash_template } )
158+ Clash_auto_route=$( grep " auto-route" ${Clash_template } | ${busybox_path} awk -F ' : ' ' {print $2}' )
159+ Clash_auto_detect_interface=$( grep " auto-detect-interface" ${Clash_template } | ${busybox_path} awk -F ' : ' ' {print $2}' )
160+ Clash_tcp_concurrent=$( grep " tcp-concurrent" ${Clash_template } | ${busybox_path} awk -F ' :' ' {print $2}' )
161+ Clash_enhanced_mode=$( grep " enhanced-mode" ${Clash_template } | ${busybox_path} awk -F ' : ' ' {print $2}' )
162+ Clash_stack_mode=$( grep " stack" ${Clash_template } | ${busybox_path} awk -F ' : ' ' {print $2}' )
163163
164164# INTERNET IPV4 & IPV6
165165reserved_ip=(0.0.0.0/8 10.0.0.0/8 100.64.0.0/10 127.0.0.0/8 169.254.0.0/16 172.16.0.0/12 192.0.0.0/24 192.0.2.0/24 192.88.99.0/24 192.168.0.0/16 198.51.100.0/24 203.0.113.0/24 224.0.0.0/4 233.252.0.0/24 240.0.0.0/4 255.255.255.255/32)
0 commit comments