This commit is contained in:
KAF:KA
2023-09-27 10:11:08 +07:00
parent 59957599f9
commit 06e0fac9e3
3 changed files with 6 additions and 6 deletions

View File

@@ -573,7 +573,7 @@ start_box() {
box_bin_status
# open the yacd in browser
open_dasboard
open_dashboard
}
stop_box() {

View File

@@ -602,7 +602,7 @@ case "$1" in
if [ -f "${box_pid}" ]; then
if kill -0 "$(<"${box_pid}" 2>/dev/null)"; then
reload
open_dasboard
open_dashboard
fi
fi
;;
@@ -616,7 +616,7 @@ case "$1" in
if [ -f "${box_pid}" ]; then
if kill -0 "$(<"${box_pid}" 2>/dev/null)"; then
reload
open_dasboard
open_dashboard
fi
fi
;;

View File

@@ -130,12 +130,12 @@ log() {
# Open yacd on start
# "cmd: Failure calling service activity: Failed transaction" if run through Magisk/KernelSu Manager,
# this is normal if run in terminal/termux
open_dasboard_on_start="false"
open_dashboard_on_start="false"
ip_port=$(if [ "${bin_name}" = "clash" ]; then busybox awk '/external-controller:/ {print $2}' "${clash_config}"; else find /data/adb/box/sing-box/ -type f -name "*.json" -exec busybox awk -F':' '/experimental/,/\}/' {} \; | sed -n 's/.*"external_controller": "\(.*\)",/\1/p'; fi;)
secret=""
open_dasboard() {
open_dashboard() {
if [[ "${bin_name}" == @(clash|sing-box) ]]; then
if [ "${open_dasboard_on_start}" = "true" ]; then
if [ "${open_dashboard_on_start}" = "true" ]; then
if [ -t 1 ]; then
su -c am start -a android.intent.action.VIEW -d "http://${ip_port}/ui/#/proxies"
fi