The complete output gets now written into the key.txt file. Thats good so far. Thank you!
Follow is the complete code block:
# ts3 Server Starten & config erstellen
/ts3/server/ts3server_startscript.sh start createinifile=1 2>&1 | tee -a /ts3/server/key.txt
sleep 3s
/ts3/server/ts3server_startscript.sh stop
sleep 3s
But the script hangs now. Follow gets written on the display but after it hangs. (maybe the sleep command ? Edit: tested .... its not the sleep command)
if you run the 'start' part with or without ...| tee ... does it "hang"?
if you run the 'stop' part, does it "hang"?
The presence of the .. 2>&1 | tee.. shouldn't make the script "hang"...
/ts3/server/ts3server_startscript.sh start createinifile=1 | tee -a /ts3/server/key.txt Doesn't hang. /ts3/server/ts3server_startscript.sh start createinifile=1 Doesn't hang. /ts3/server/ts3server_startscript.sh start createinifile=1 2>&1 /ts3/server/key.txt Doesn't hang. (No key.txt file gets createt) /ts3/server/ts3server_startscript.sh start createinifile=1 2>&1 | tee -a /ts3/server/key.txt Does hang, the script doesn't continue after the output (see last post)
I don't need to create log files for the 'stop' parameter. But i tested it for you. It works fine with the stop parameter: ./ts3server_startscript.sh stop 2>&1 | tee -a ./test.txt
Edit:
This code works. It saves the key in the text. After that shows the key with cat.
It's not the best solution but it works.