mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-30 20:43:02 +02:00
32 lines
441 B
Bash
Executable File
32 lines
441 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
|
|
if [ "$USER" = "root" ]; then
|
|
dir "$HOME"
|
|
else
|
|
dir "/home/$USER"
|
|
fi
|
|
dir "/cfg"
|
|
dir "/log"
|
|
fi
|