mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-11 16:01:28 +00:00
18 lines
396 B
Bash
18 lines
396 B
Bash
|
|
[ -z "$CRASHDIR" ] && CRASHDIR=$( cd $(dirname $0);cd ..;pwd)
|
|
PIDFILE="/tmp/ShellCrash/$1.pid"
|
|
|
|
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
|
|
|