mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
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:
@@ -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()
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user