mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-30 12:33:02 +02:00
These changes are designed to make the experience working with log files easier. Both listing available log files and viewing them. - replace C dir@infix with a shell script for easier extensions, e.g., we want to show both available .cfg and log files - add support for gunzipping .gz log files before viewing them Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
28 lines
375 B
Bash
Executable File
28 lines
375 B
Bash
Executable File
#!/bin/sh
|
|
|
|
dir()
|
|
{
|
|
path=$1
|
|
|
|
if [ -z "$COLUMS" ]; then
|
|
TTY=$(resize)
|
|
eval "$TTY"
|
|
fi
|
|
|
|
printf "\033[7m%-*s\033[0m\n" "$COLUMNS" "$path directory"
|
|
if [ -d "$path" ]; then
|
|
ls -p "$path/"
|
|
else
|
|
echo "Directory $path does not exist."
|
|
fi
|
|
echo
|
|
}
|
|
|
|
if [ -d "$1" ]; then
|
|
dir "$1"
|
|
else
|
|
dir "$HOME"
|
|
dir "/cfg"
|
|
dir "/log"
|
|
fi
|