diff --git a/scripts/libs/core_tools.sh b/scripts/libs/core_tools.sh index 98dfb1c1..42d6cbba 100644 --- a/scripts/libs/core_tools.sh +++ b/scripts/libs/core_tools.sh @@ -23,7 +23,9 @@ core_unzip() { #$1:需要解压的文件 $2:目标文件名 } core_find(){ if [ ! -f "$TMPDIR"/CrashCore ];then - core_dir=$(find "$BINDIR"/CrashCore.* $find_para 2>/dev/null) + [ -n "$(find "$CRASHDIR"/CrashCore.* $find_para 2>/dev/null)" ] && + mv -f "$CRASHDIR"/CrashCore.* "$BINDIR"/ + core_dir=$(find "$BINDIR"/CrashCore.* $find_para 2>/dev/null | head -n 1) [ -n "$core_dir" ] && core_unzip "$core_dir" CrashCore fi } @@ -49,7 +51,12 @@ core_check(){ else mv -f "$1" "$BINDIR/CrashCore.$zip_type" fi - mv -f "$TMPDIR/core_new" "$TMPDIR/CrashCore" + if [ "$zip_type" = 'upx' ];then + rm -f "$1" "$TMPDIR"/core_new + ln -sf "$TMPDIR/CrashCore.upx" "$TMPDIR/CrashCore" + else + mv -f "$TMPDIR/core_new" "$TMPDIR/CrashCore" + fi core_v="$v" setconfig COMMAND "$COMMAND" "$CRASHDIR"/configs/command.env && . "$CRASHDIR"/configs/command.env setconfig crashcore "$crashcore" @@ -73,7 +80,7 @@ core_webget(){ if [ "$?" = 0 ];then core_check "$TMPDIR/Coretmp.$zip_type" else - rm -rf "$TMPDIR/Coretmp.$zip_type" + rm -f "$TMPDIR/Coretmp.$zip_type" return 1 fi } diff --git a/scripts/starts/afstart.sh b/scripts/starts/afstart.sh index 675c0f3b..504289e6 100644 --- a/scripts/starts/afstart.sh +++ b/scripts/starts/afstart.sh @@ -55,5 +55,4 @@ if [ -n "$test" -o -n "$(pidof CrashCore)" ]; then exit 0 else . "$CRASHDIR"/starts/start_error.sh - "$CRASHDIR"/start.sh stop fi diff --git a/scripts/starts/start_error.sh b/scripts/starts/start_error.sh index 66c8b2e7..13726b50 100644 --- a/scripts/starts/start_error.sh +++ b/scripts/starts/start_error.sh @@ -11,3 +11,4 @@ touch "$CRASHDIR"/.start_error #标记启动失败,防止自启 error=$(cat "$TMPDIR"/core_test.log | grep -iEo 'error.*=.*|.*ERROR.*|.*FATAL.*') logger "服务启动失败!请查看报错信息!详细信息请查看$TMPDIR/core_test.log" 33 logger "$error" 31 +"$CRASHDIR"/start.sh stop