Merge branch 'master' into dev

# Conflicts:
#	ShellCrash.tar.gz
#	bin/version
#	version
This commit is contained in:
juewuy
2026-02-08 19:50:30 +08:00
8 changed files with 34 additions and 20 deletions

View File

@@ -42,6 +42,8 @@ get_core_config() { #下载内核配置文件
fi
Https="${Server}/sub?target=${target}&${Server_ua}=${user_agent}&insert=true&new_name=true&scv=true&udp=true&${urlencodeUrl}"
url_type=true
else
Https=$(echo $Https | sed 's/\\&/\&/g') #还原转义
fi
#输出
echo "-----------------------------------------------"

View File

@@ -1,20 +1,28 @@
[ -z "$CRASHDIR" ] && CRASHDIR=$( cd $(dirname $0);cd ..;pwd)
[ -z "$CRASHDIR" ] && CRASHDIR=$(cd "$(dirname "$0")"/.. && pwd)
PIDFILE="/tmp/ShellCrash/$1.pid"
[ -f "$CRASHDIR"/.start_error ] && [ ! -f /tmp/ShellCrash/crash_start_time ] && exit 1 #当启动失败后禁止开机自启动
if [ -f "$PIDFILE" ]; then
PID="$(cat "$PIDFILE")"
if [ -n "$PID" ] && [ -d "/proc/$PID" ]; then
return 0
if [ -n "$PID" ] && [ "$PID" -eq "$PID" ] 2>/dev/null; then
if kill -0 "$PID" 2>/dev/null || [ -d "/proc/$PID" ]; then
return 0
fi
else
rm -f "$PIDFILE"
fi
fi
#如果没有进程则拉起
if [ "$1" = shellcrash ];then
"$CRASHDIR"/start.sh start
else
. "$CRASHDIR"/starts/start_legacy.sh
start_legacy "$CRASHDIR/menus/bot_tg.sh" "$1"
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"
start_legacy "$CRASHDIR/menus/bot_tg.sh" "$1"
fi
rm -d "$LOCKDIR" 2>/dev/null
fi