mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-10 23:41:22 +00:00
20 lines
525 B
Bash
20 lines
525 B
Bash
|
|
[ -z "$CRASHDIR" ] && CRASHDIR=$( cd $(dirname $0);cd ..;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
|
|
fi
|
|
fi
|
|
#如果没有进程则拉起
|
|
if [ "$1" = shellcrash ];then
|
|
"$CRASHDIR"/start.sh start
|
|
else
|
|
. "$CRASHDIR"/starts/start_legacy.sh
|
|
start_legacy "$CRASHDIR/menus/bot_tg.sh" "$1"
|
|
fi
|
|
|