Merge pull request #943 from NickVeld/old_screen_logging

screen<=4.5 generates smarthack-*.log now too
pull/890/head
Colin Kuebler 2021-11-13 15:06:21 -05:00 committed by GitHub
commit cbdccb772a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 3 deletions

21
scripts/old_screen_with_log.sh Executable file
View File

@ -0,0 +1,21 @@
# Run screen with a custom .screenrc that defines the name of "logfile"
screen_minor=${1}
screen_logfile_name=${2}
screen_other_options=${@:3}
if [ "$screen_minor" -gt 5 ]; then
echo "Info: you have the modern enough version" \
"to use the \"-Logfile\" flag of \"screen\""
elif [ "$screen_minor" -eq 5 ]; then
screen_with_log="sudo screen -L"
else
screen_with_log="sudo screen -L -t"
fi
echo "logfile ${screen_logfile_name}" > ${screen_logfile_name}.screenrc
${screen_with_log} ${screen_logfile_name} \
-c ${screen_logfile_name}.screenrc ${screen_other_options}
rm ${screen_logfile_name}.screenrc

View File

@ -10,10 +10,8 @@ setup () {
screen_minor=$(screen --version | cut -d . -f 2)
if [ "$screen_minor" -gt 5 ]; then
screen_with_log="sudo screen -L -Logfile"
elif [ "$screen_minor" -eq 5 ]; then
screen_with_log="sudo screen -L"
else
screen_with_log="sudo screen -L -t"
screen_with_log="./old_screen_with_log.sh ${screen_minor}"
fi
echo "======================================================"
echo -n " Starting AP in a screen"