mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-10 23:41:22 +00:00
Compare commits
13 Commits
1.9.4rc6.1
...
0b7f7161b0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b7f7161b0 | ||
|
|
02a342cbd1 | ||
|
|
1fbade025a | ||
|
|
f5394120e1 | ||
|
|
0589bc7881 | ||
|
|
3b578c7988 | ||
|
|
7f73133657 | ||
|
|
952e1a8f63 | ||
|
|
b3ac793f6e | ||
|
|
37269ef851 | ||
|
|
f2ce2fb9b4 | ||
|
|
d86969bf9b | ||
|
|
dfc6910bc3 |
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
meta_v=v1.19.17
|
||||
singboxr_v=1.13.0-alpha.27
|
||||
versionsh=1.9.4rc6
|
||||
versionsh=1.9.4release
|
||||
GeoIP_v=20251205
|
||||
|
||||
@@ -72,8 +72,11 @@ core_webget(){
|
||||
[ -z "$zip_type" ] && zip_type='tar.gz'
|
||||
get_bin "$TMPDIR/Coretmp.$zip_type" "bin/$crashcore/${target}-linux-${cpucore}.$zip_type"
|
||||
else
|
||||
zip_type=$(echo "$custcorelink" | grep -oE 'tar.gz$')
|
||||
[ -z "$zip_type" ] && zip_type=$(echo "$custcorelink" | grep -oE 'gz$')
|
||||
case "$custcorelink" in
|
||||
*.tar.gz) zip_type="tar.gz" ;;
|
||||
*.gz) zip_type="gz" ;;
|
||||
*.upx) zip_type="upx" ;;
|
||||
esac
|
||||
[ -n "$zip_type" ] && webget "$TMPDIR/Coretmp.$zip_type" "$custcorelink"
|
||||
fi
|
||||
#校验内核
|
||||
|
||||
@@ -295,7 +295,7 @@ set_fw_filter(){ #流量过滤
|
||||
echo -e " 1 过滤非常用端口: \033[36m$common_ports\033[0m ————用于过滤P2P流量"
|
||||
echo -e " 2 过滤局域网设备: \033[36m$mac_return\033[0m ————使用黑/白名单进行过滤"
|
||||
echo -e " 3 过滤QUIC协议: \033[36m$quic_rj\033[0m ————优化视频性能"
|
||||
echo -e " 4 过滤CN_IP(6)列表: \033[36m$cn_ip_route\033[0m ————优化性能,不兼容Fake-ip"
|
||||
echo -e " 4 过滤CN_IP列表: \033[36m$cn_ip_route\033[0m ————优化性能,不兼容Fake-ip"
|
||||
echo -e " 5 自定义透明路由ipv4网段: 适合vlan等复杂网络环境"
|
||||
echo -e " 6 自定义保留地址ipv4网段: 需要以保留地址为访问目标的环境"
|
||||
echo "-----------------------------------------------"
|
||||
|
||||
@@ -183,7 +183,8 @@ set_bot_tg_service(){
|
||||
. "$CRASHDIR"/menus/bot_tg_service.sh && bot_tg_stop
|
||||
else
|
||||
bot_tg_service=ON
|
||||
[ -n "$(pidof CrashCore)" ] && . "$CRASHDIR"/menus/bot_tg_service.sh && bot_tg_start
|
||||
[ -n "$(pidof CrashCore)" ] && . "$CRASHDIR"/menus/bot_tg_service.sh &&
|
||||
bot_tg_start && bot_tg_cron
|
||||
fi
|
||||
setconfig bot_tg_service "$bot_tg_service"
|
||||
}
|
||||
@@ -195,6 +196,7 @@ set_bot_tg(){
|
||||
echo "-----------------------------------------------"
|
||||
echo -e " 1 启用/关闭TG-BOT服务 \033[32m$bot_tg_service\033[0m"
|
||||
echo -e " 2 TG-BOT绑定设置 \033[32m$TG_CHATID_info\033[0m"
|
||||
echo -e " 3 启动时推送菜单 \033[32m$TG_menupush\033[0m"
|
||||
echo -e " 0 返回上级菜单 \033[0m"
|
||||
echo "-----------------------------------------------"
|
||||
read -p "请输入对应数字 > " num
|
||||
@@ -223,6 +225,15 @@ set_bot_tg(){
|
||||
set_bot_tg_init
|
||||
set_bot_tg
|
||||
;;
|
||||
3)
|
||||
if [ "$TG_menupush" = ON ];then
|
||||
TG_menupush=OFF
|
||||
else
|
||||
TG_menupush=ON
|
||||
fi
|
||||
setconfig TG_menupush "$TG_menupush" "$GT_CFG_PATH"
|
||||
set_bot_tg
|
||||
;;
|
||||
*)
|
||||
errornum
|
||||
;;
|
||||
|
||||
@@ -354,7 +354,7 @@ setcustcore(){ #自定义内核
|
||||
checkcustcore
|
||||
;;
|
||||
9)
|
||||
read -p "请输入自定义内核的链接地址(必须是以.tar.gz或.gz结尾的压缩文件) > " link
|
||||
read -p "请输入自定义内核的链接地址(必须是以.tar.gz、.upx或.gz结尾的压缩文件) > " link
|
||||
[ -n "$link" ] && custcorelink="$link"
|
||||
setcoretype
|
||||
getcore
|
||||
@@ -398,7 +398,7 @@ setcore() {
|
||||
[ -z "$crashcore" ] && crashcore="unknow"
|
||||
[ -z "$zip_type" ] && zip_type="tar.gz"
|
||||
echo "$crashcore" | grep -q 'singbox' && core_old=singbox || core_old=clash
|
||||
[ -n "$custcorelink" ] && custcore="$(echo $custcorelink | sed 's#.*github.com##; s#/releases/download/#@#; s#-linux.*$##')"
|
||||
[ -n "$custcorelink" ] && custcore="$(echo $custcorelink | sed 's#.*github.com##; s#/releases/download/#@#')"
|
||||
###
|
||||
echo "-----------------------------------------------"
|
||||
[ -z "$cpucore" ] && check_cpucore
|
||||
|
||||
@@ -320,7 +320,7 @@ polling(){
|
||||
done
|
||||
}
|
||||
|
||||
#send_menu
|
||||
[ "$TG_menupush" = ON ] && send_menu
|
||||
|
||||
polling
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
bot_tg_start(){
|
||||
. "$CRASHDIR"/starts/start_legacy.sh
|
||||
start_legacy "$CRASHDIR/menus/bot_tg.sh" 'bot_tg'
|
||||
bot_tg_cron
|
||||
}
|
||||
bot_tg_stop(){
|
||||
cronload | grep -q 'TG_BOT' && cronset 'TG_BOT'
|
||||
|
||||
@@ -11,10 +11,10 @@ clash_check() { #clash启动前检查
|
||||
[ "$crashcore" = "clash" ] && [ "$firewall_area" = 2 -o "$firewall_area" = 3 ] && [ -z "$(grep '0:7890' /etc/passwd)" ] &&
|
||||
core_exchange meta '当前内核不支持非root用户启用本机代理'
|
||||
check_core
|
||||
#预下载GeoIP数据库并排除存在自定义数据库链接的情况
|
||||
[ -n "$(grep -oEi 'geoip:' "$CRASHDIR"/yamls/config.yaml)" ] && check_geo Country.mmdb cn_mini.mmdb
|
||||
#预下载GeoSite数据库并排除存在自定义数据库链接的情况
|
||||
[ -n "$(grep -oEi 'geosite:' "$CRASHDIR"/yamls/config.yaml)" ] && check_geo GeoSite.dat geosite.dat
|
||||
#预下载GeoIP数据库
|
||||
grep -qEi 'GEOIP,CN' "$CRASHDIR"/yamls/config.yaml && ! grep -Eq '^[[:space:]]*geodata-mode:' "$CRASHDIR"/yamls/*.yaml && check_geo Country.mmdb cn_mini.mmdb
|
||||
#预下载GeoSite数据库
|
||||
grep -qEi 'GEOSITE,' "$CRASHDIR"/yamls/config.yaml && ! grep -Eq '^[[:space:]]*geosite:' "$CRASHDIR"/yamls/*.yaml && check_geo GeoSite.dat geosite.dat
|
||||
#预下载cn.mrs数据库
|
||||
[ "$dns_mod" = "mix" ] || [ "$dns_mod" = "route" ] && ! grep -Eq '^[[:space:]]*cn:' "$CRASHDIR"/yamls/*.yaml && check_geo ruleset/cn.mrs mrs_geosite_cn.mrs
|
||||
return 0
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
|
||||
[ -z "$CRASHDIR" ] && CRASHDIR=$(cd "$(dirname "$0")"/.. && pwd)
|
||||
PIDFILE="/tmp/ShellCrash/$1.pid"
|
||||
LOCKDIR="/tmp/ShellCrash/start_$1.lock"
|
||||
|
||||
[ -f "$CRASHDIR"/.start_error ] && [ ! -f /tmp/ShellCrash/crash_start_time ] && exit 1 #当启动失败后禁止开机自启动
|
||||
mkdir "$LOCKDIR" 2>/dev/null || exit 1
|
||||
|
||||
if [ -f "$PIDFILE" ]; then
|
||||
PID="$(cat "$PIDFILE")"
|
||||
if [ -n "$PID" ] && [ "$PID" -eq "$PID" ] 2>/dev/null; then
|
||||
if kill -0 "$PID" 2>/dev/null || [ -d "/proc/$PID" ]; then
|
||||
return 0
|
||||
rm -d "$LOCKDIR" 2>/dev/null
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
rm -f "$PIDFILE"
|
||||
@@ -16,13 +19,12 @@ if [ -f "$PIDFILE" ]; then
|
||||
fi
|
||||
|
||||
#如果没有进程则拉起
|
||||
LOCKDIR="/tmp/ShellCrash/start_$1.lock"
|
||||
if mkdir "$LOCKDIR" 2>/dev/null; then
|
||||
if [ "$1" = "shellcrash" ]; then
|
||||
"$CRASHDIR"/start.sh start
|
||||
else
|
||||
[ -f "$CRASHDIR/starts/start_legacy.sh" ] && . "$CRASHDIR/starts/start_legacy.sh"
|
||||
killall bot_tg.sh 2>/dev/null
|
||||
start_legacy "$CRASHDIR/menus/bot_tg.sh" "$1"
|
||||
fi
|
||||
|
||||
rm -d "$LOCKDIR" 2>/dev/null
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user