board/common: fix shell and clish 'follow' commands

We want the command to show the entire log file, but fast forward to and
tail at the end, handling any file rotations from syslogd.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2026-01-26 18:22:55 +01:00
parent 289544a299
commit 6c0fd3e96b
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -40,11 +40,12 @@ log()
less +G -r "$fn"
}
follow()
follow ()
{
local fn="/var/log/syslog"
[ -n "$1" ] && fn="/var/log/$1"
less +F -r "$fn"
tail -F -n +1 "$fn"
}
_logfile_completions()
+1 -1
View File
@@ -744,7 +744,7 @@
<ACTION sym="script" in="tty" out="tty" interrupt="true">
file=${KLISH_PARAM_fn:-syslog}
echo -e "\e[1mPress Ctrl-C to abort ────────────────────────────────────────────\e[0m"
tail -F /log/$file
tail -F -n +1 /log/$file
</ACTION>
</COMMAND>