File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ echo "entrypoint.sh: activate log checker!"
8484
8585pipe=$( mktemp -u)
8686mkfifo $pipe
87- $STARTCMD $ARGS > $pipe &
87+ $STARTCMD $ARGS > $pipe 2>&1 &
8888SRV_PID=$!
8989SHELL_PID=$$
9090
@@ -94,12 +94,15 @@ SteamSockets API: Error"
9494(while IFS= read -r line; do
9595 printf ' %s\n' " $line "
9696
97- while IFS=$( printf ' \n' ) read -r TARGET; do
98- if ! echo " $line " | grep -q " $TARGET " ; then
97+ while IFS=$( printf ' \n' ) read -r target; do
98+ if ! grep -Fq " $target " << EOF
99+ $line
100+ EOF
101+ then
99102 continue
100103 fi
101104
102- echo " \n======== entrypoint.sh ========\nentrypoint.sh: detected \" $TARGET \" , exiting!\n================================"
105+ echo " \n======== entrypoint.sh ========\nentrypoint.sh: detected \" $target \" , exiting!\n================================"
103106 rm -f $pipe
104107 kill " $SRV_PID "
105108 kill " $SHELL_PID "
Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ A simple script will `rm -rf /home/5k/.wine` everytime before server starting
142142
143143### Log Checker
144144
145- A simple script will keep watching the stdout, and if it find any matched strings, it will kill the server
145+ A simple script will keep watching the stdout and stderr , and if it find any matched strings, it will kill the server
146146
147147Default matched strings: ` FOnlineAsyncTaskSteamCreateServer bWasSuccessful: 0 ` , ` SteamSockets API: Error `
148148
@@ -291,7 +291,7 @@ docker run --name scp5kserver -p 7777:7777/tcp -p 7777:7777/udp -p 27015:27015/t
291291
292292### Log Checker
293293
294- 一个简单的脚本,会持续监听标准输出(stdout),如果发现匹配的字符串,就会杀掉服务器
294+ 一个简单的脚本,会持续监听标准输出(stdout)和标准错误(stderr) ,如果发现匹配的字符串,就会杀掉服务器
295295
296296默认匹配字符串:` FOnlineAsyncTaskSteamCreateServer bWasSuccessful: 0 ` , ` SteamSockets API: Error `
297297
You can’t perform that action at this time.
0 commit comments