Skip to content
This repository was archived by the owner on Feb 28, 2023. It is now read-only.

Commit 7b6c44f

Browse files
author
llycoris
committed
rename 'v2dns' to 'dnstt-client'
1 parent 1ebf0a6 commit 7b6c44f

4 files changed

Lines changed: 33 additions & 30 deletions

File tree

customize.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ mv ${clash_data_dir_kernel}/getcap ${MODPATH}${bin_path}/
107107
mv ${clash_data_dir}/scripts/clash.config ${clash_data_dir}/
108108
mv ${clash_data_dir}/scripts/mosdns ${clash_data_dir}/
109109
mv ${clash_data_dir}/mosdns/mosdns ${clash_data_dir_kernel}/
110-
mv ${clash_data_dir}/mosdns/v2dns ${clash_data_dir_kernel}/
110+
mv ${clash_data_dir}/mosdns/dnstt-client ${clash_data_dir_kernel}/
111111

112112
if [ ! -f "${bin_path}/ss" ] ; then
113113
mv ${clash_data_dir_kernel}/ss ${MODPATH}${bin_path}/
@@ -149,7 +149,7 @@ set_perm ${clash_data_dir}/scripts/clash.cron 0 0 0755
149149
set_perm ${clash_data_dir}/scripts/start.sh 0 0 0755
150150
set_perm ${clash_data_dir}/clash.config ${uid} ${gid} 0755
151151
set_perm ${clash_data_dir}/kernel/mosdns 0 0 0755
152-
set_perm ${clash_data_dir}/kernel/v2dns 0 0 0755
152+
set_perm ${clash_data_dir}/kernel/dnstt-client 0 0 0755
153153
set_perm ${clash_service_dir}/clash_service.sh 0 0 0755
154154
sleep 1
155155
ui_print "- Installation is complete, reboot your device"

scripts/clash.config

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,12 @@ Clash_enhanced_mode=$(grep "enhanced-mode" ${Clash_template} | ${busybox_path} a
167167

168168
# V2DNS, 0 is V2DNS OFF, 1 is V2DNS ON
169169
# CREATE akun V2DNS di WHYVPN , WEB LAIN BELUM TAU
170-
run_v2dns="0"
171-
dns_for_v2dns="1.1.1.1"
172-
pubkey="6a7a2617c8cb81957ab0241bb0c72db0acae392ad7c133f5b793c184a9360c20"
173-
nsdomain="ns-do3.kitu.xyz"
170+
dnstt_bin_name="dnstt-client"
171+
dnstt_client_bin="$Clash_bin/$dnstt_bin_name"
172+
run_dnstt="0"
173+
dns_for_dnstt="1.1.1.1"
174+
pubkey=""
175+
nsdomain=""
174176

175177
# AIDs=(3005 9999)
176178
# INTERNET IPV4 & IPV6

scripts/clash.service

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ start_clash() {
257257
if [ "${run_mosdns}" == "1" ]; then
258258
mosdns
259259
else
260-
echo $date_log"info: mosdns is disabled" >> ${CFM_logs_file}
260+
echo $date_log"info: mos-dns is disabled" >> ${CFM_logs_file}
261261
rm -rf ${Clash_run_path}/mosdns.log
262262
fi
263263

@@ -305,14 +305,14 @@ kill_mosdns() {
305305
fi
306306
}
307307

308-
kil_v2dns() {
309-
if (kill -15 `cat ${Clash_run_path}/v2dns.pid`); then
310-
v2dnskill=$(ps -ef | grep root | grep "/data/clash/kernel/v2dns" | ${busybox_path} awk '{ print $2 }')
311-
for v2kill in ${v2dnskill[*]} ; do
312-
kill -15 ${v2kill}
308+
kil_dnstt() {
309+
if (kill -15 `cat ${Clash_run_path}/dnstt.pid`); then
310+
dnsttkill=$(ps -ef | grep root | grep "$dnstt_client_bin" | ${busybox_path} awk '{ print $2 }')
311+
for dnskill in ${dnsttkill[*]} ; do
312+
kill -15 ${dnskill}
313313
done
314-
rm -rf ${Clash_run_path}/v2dns.pid
315-
echo $date_log"warn: v2dns terminated。" >> ${CFM_logs_file}
314+
rm -rf ${Clash_run_path}/dnstt.pid
315+
echo $date_log"warn: $dnstt_bin_name terminated。" >> ${CFM_logs_file}
316316
fi
317317
}
318318

@@ -321,7 +321,7 @@ stop_clash() {
321321
ceks_clash
322322
kill_crond
323323
kill_mosdns
324-
kil_v2dns
324+
kil_dnstt
325325

326326
rm -rf ${Clash_pid_file} && rm -rf ${Clash_run_path}/appuid.list
327327
echo $date_log"warn: Clash terminated。" >> ${CFM_logs_file}

scripts/clash.tool

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -285,32 +285,33 @@ up_dashboard() {
285285
rm -rf ${file_dasboard}
286286
}
287287

288-
v2dns() {
289-
if [ "${run_v2dns}" == "1" ]; then
290-
if [ -f /data/clash/kernel/v2dns ]; then
291-
chmod 755 /data/clash/kernel/v2dns
288+
dnstt_client() {
289+
if [ "${run_dnstt}" == "1" ]; then
290+
if [ -f $dnstt_client_bin ]; then
291+
chmod 0755 $dnstt_client_bin
292+
chown root:net_admin ${dnstt_client_bin}
292293
if [ ! ${nsdomain} == "" ] && [ ! ${pubkey} == "" ]; then
293-
nohup /data/clash/kernel/v2dns -udp ${dns_for_v2dns}:53 -pubkey ${pubkey} ${nsdomain} 127.0.0.1:9553 > /dev/null 2>&1 &
294-
echo -n $! > ${Clash_run_path}/v2dns.pid
294+
nohup $dnstt_client_bin -udp ${dns_for_dnstt}:53 -pubkey ${pubkey} ${nsdomain} 127.0.0.1:9553 > /dev/null 2>&1 &
295+
echo -n $! > ${Clash_run_path}/dnstt.pid
295296

296297
sleep 0.75
297-
local v2dns_pid=`cat ${Clash_run_path}/v2dns.pid 2> /dev/null`
298-
if (cat /proc/${v2dns_pid}/cmdline | grep -q v2dns) ; then
299-
echo ${date_log}"info: v2dns is enable." >> ${CFM_logs_file}
298+
local dnstt_pid=`cat ${Clash_run_path}/dnstt.pid 2> /dev/null`
299+
if (cat /proc/"$dnstt_pid"/cmdline | grep -q $dnstt_bin_name) ; then
300+
echo ${date_log}"info: $dnstt_bin_name is enable." >> ${CFM_logs_file}
300301
else
301-
echo ${date_log}"err: v2dns The configuration is incorrect," >> ${CFM_logs_file}
302+
echo ${date_log}"err: $dnstt_bin_name The configuration is incorrect," >> ${CFM_logs_file}
302303
echo ${date_log}"err: the startup fails, and the following is the error" >> ${CFM_logs_file}
303-
kill -15 `cat ${Clash_run_path}/v2dns.pid`
304+
kill -15 `cat ${Clash_run_path}/dnstt.pid`
304305
fi
305306
else
306-
echo ${date_log}"warn: v2dns tidak aktif," >> ${CFM_logs_file}
307+
echo ${date_log}"warn: $dnstt_bin_name tidak aktif," >> ${CFM_logs_file}
307308
echo ${date_log}"warn: 'nsdomain' & 'pubkey' kosong," >> ${CFM_logs_file}
308309
fi
309310
else
310-
echo ${date_log}"err: kernel v2dns tidak ada." >> ${CFM_logs_file}
311+
echo ${date_log}"err: kernel $dnstt_bin_name tidak ada." >> ${CFM_logs_file}
311312
fi
312313
else
313-
echo "" #${date_log}"info: v2dns is disable." >> ${CFM_logs_file}
314+
echo $date_log"info: $dnstt_bin_name is disabled" >> ${CFM_logs_file}
314315
fi
315316
}
316317

@@ -363,7 +364,7 @@ while getopts ":fmspokldvg" signal ; do
363364
up_dashboard
364365
;;
365366
v)
366-
v2dns
367+
dnstt_client
367368
;;
368369
g)
369370
getmemory

0 commit comments

Comments
 (0)