version upgrades, toolbox WIP
This commit is contained in:
parent
12419e71e2
commit
9e56434b0b
7 changed files with 80 additions and 5 deletions
15
toolbox/Dockerfile
Normal file
15
toolbox/Dockerfile
Normal file
|
@ -0,0 +1,15 @@
|
|||
FROM registry.fedoraproject.org/fedora:38
|
||||
|
||||
ENV PKGS_GENERAL="htop \
|
||||
btop"
|
||||
|
||||
RUN dnf clean all && \
|
||||
dnf install -y ${PKGS_GENERAL} && \
|
||||
dnf -y autoremove && \
|
||||
dnf -y clean all
|
||||
|
||||
COPY help-toolbox.sh /usr/bin/help-toolbox
|
||||
|
||||
RUN chmod 555 /usr/bin/help-toolbox
|
||||
|
||||
USER root
|
46
toolbox/help-toolbox.sh
Normal file
46
toolbox/help-toolbox.sh
Normal file
|
@ -0,0 +1,46 @@
|
|||
#!/bin/bash
|
||||
|
||||
# print $1 element $2 times, or if only one argument
|
||||
# supplied then print space $1 times
|
||||
function repeat() {
|
||||
x=0
|
||||
|
||||
if [ $# -eq 2 ]; then
|
||||
char="$1"
|
||||
count="$2"
|
||||
else
|
||||
char=" "
|
||||
count="$1"
|
||||
fi
|
||||
while [ $x -lt "$count" ];
|
||||
do
|
||||
echo -n "$char"
|
||||
x=$((x+1))
|
||||
done
|
||||
}
|
||||
# print "fancy title"
|
||||
function printTitle() {
|
||||
termWidth=$(tput cols)
|
||||
textWidth=$(echo -n "$1" | wc -c)
|
||||
spaces1=$(((termWidth-textWidth-2) / 2))
|
||||
spaces2=$((termWidth-spaces1-textWidth-2))
|
||||
|
||||
repeat "#" "$termWidth"
|
||||
echo ""
|
||||
echo -n "#"
|
||||
repeat $spaces1
|
||||
echo -n "$1"
|
||||
repeat $spaces2
|
||||
echo "#"
|
||||
repeat "#" "$termWidth"
|
||||
}
|
||||
|
||||
# print tools sorted by category
|
||||
|
||||
printTitle "Toolbox pkgs"
|
||||
|
||||
printTitle "General"
|
||||
printTitle "Processes"
|
||||
printTitle "Network"
|
||||
printTitle "Memory"
|
||||
printTitle "Storage"
|
Loading…
Add table
Add a link
Reference in a new issue