Files
ShellCrash/scripts/menus/1_start.sh
juewuy ebba797473 ~增加小米设备对autossh脚本的兼容
~增加小米设备/data/auto_start.sh文件,用于自定义开机启动项
~增加Mihomo内核默认启用统一延迟功能
~优化默认DNS,现在会默认使用localhost(如果可用)而不是阿里dns
~优化子菜单加载效率
~优化部分设备的tun加载流程,修复因为未加载tun模块而导致的启动报错
~优化dns界面显示
~修复因为文件拆分路径改变导致的加载失败的一系列bug
~修复局域网过滤白名单失效的bug(需要重新启用)
~修复自定义入站启用失败的bug
~修复前台测试内核运行命令报错的bug
~修复卸载时的意外报错
2025-12-31 15:07:21 +08:00

53 lines
2.0 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
# Copyright (C) Juewuy
[ -n "$__IS_MODULE_1_START_LOADED" ] && return
__IS_MODULE_1_START_LOADED=1
#启动相关
startover() {
echo -ne " \r"
echo -e "\033[32m服务已启动\033[0m"
echo -e "请使用 \033[4;36mhttp://$host$hostdir\033[0m 管理内置规则"
if [ "$redir_mod" = "纯净模式" ]; then
echo "-----------------------------------------------"
echo -e "其他设备可以使用PAC配置连接\033[4;32mhttp://$host:$db_port/ui/pac\033[0m"
echo -e "或者使用HTTP/SOCK5方式连接IP{\033[36m$host\033[0m}端口{\033[36m$mix_port\033[0m}"
fi
return 0
}
start_core() {
if echo "$crashcore" | grep -q 'singbox'; then
core_config="$CRASHDIR"/jsons/config.json
else
core_config="$CRASHDIR"/yamls/config.yaml
fi
echo "-----------------------------------------------"
if [ ! -s $core_config -a -s "$CRASHDIR"/configs/providers.cfg ]; then
echo -e "\033[33m没有找到${crashcore}配置文件尝试生成providers配置文件\033[0m"
[ "$crashcore" = singboxr ] && coretype=singbox
[ "$crashcore" = meta -o "$crashcore" = clashpre ] && coretype=clash
. "$CRASHDIR"/menus/6_core_config.sh && gen_${coretype}_providers
elif [ -s $core_config -o -n "$Url" -o -n "$Https" ]; then
"$CRASHDIR"/start.sh start
#设置循环检测以判定服务启动是否成功
. "$CRASHDIR"/libs/start_wait.sh
[ -n "$test" -o -n "$(pidof CrashCore)" ] && {
#启动TG机器人
[ "$bot_tg_service" = ON ] && . "$CRASHDIR"/menus/bot_tg_service.sh && bot_tg_start
startover
}
else
echo -e "\033[31m没有找到${crashcore}配置文件,请先导入配置文件!\033[0m"
. "$CRASHDIR"/menus/6_core_config.sh && set_core_config
fi
}
start_service() {
if [ "$firewall_area" = 5 ]; then
"$CRASHDIR"/start.sh start
echo -e "\033[32m已完成防火墙设置\033[0m"
else
start_core
fi
}