Skip to content

Commit

Permalink
feat: Display kernel version (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
kroese authored Apr 26, 2024
1 parent 437d595 commit 0cbd572
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ TEMPLATE="/var/www/index.html"
FOOTER1="$APP for Docker v$(</run/version)"
FOOTER2="<a href='$SUPPORT'>$SUPPORT</a>"

SYS=$(uname -r)
HOST=$(hostname -s)
KERNEL=$(uname -r | cut -b 1)
MINOR=$(uname -r | cut -d '.' -f2)
KERNEL=$(echo "$SYS" | cut -b 1)
MINOR=$(echo "$SYS" | cut -d '.' -f2)
ARCH=$(dpkg --print-architecture)
RAM="$(free -g | grep Mem: | awk '{print $7}')/$(free -g | grep Mem: | awk '{print $2}') GB"
CPU=$(lscpu | grep 'Model name' | cut -f 2 -d ":" | awk '{$1=$1}1' | sed 's# @.*##g' | sed s/"(R)"//g | sed 's/[^[:alnum:] ]\+/ /g' | sed 's/ */ /g')
Expand All @@ -60,12 +61,13 @@ if [ ! -d "$STORAGE" ]; then
fi

# Print system info
SYS="${SYS/-generic/}"
FS=$(stat -f -c %T "$STORAGE")
FS="${FS/ext2\/ext3/ext4}";
FS="${FS/ext2\/ext3/ext4}"
SPACE=$(df --output=avail -B 1 "$STORAGE" | tail -n 1)
SPACE_GB=$(( (SPACE + 1073741823)/1073741824 ))

echo "❯ CPU: ${CPU} | RAM: ${RAM} | DISK: $SPACE_GB GB (${FS}) | HOST: $(uname -r)..."
echo "❯ CPU: ${CPU} | RAM: ${RAM} | DISK: $SPACE_GB GB (${FS}) | HOST: ${SYS}..."
echo

# Helper functions
Expand Down

0 comments on commit 0cbd572

Please sign in to comment.