dotfiles/.etc/motd.sh
2023-01-11 08:25:32 +01:00

32 lines
800 B
Bash

#!/bin/sh
OS=$(uname -s)
OSVER=$(uname -r)
OSARCH=$(uname -m)
CPUS=$(sysctl -n hw.ncpuonline)
CPUMODEL=$(sysctl -n hw.model)
CPUSPEED=$(sysctl -n hw.cpuspeed)
MEM=$(echo "$(sysctl -n hw.physmem)/1024/1024" | bc)
INET=$(ifconfig trunk0 | grep "inet" | grep -v fe80 | cut -d" " -f1,2)
printf '%s\n' ' ___ _____ ____ ____ _ _ _____ ____ ____
/ __)( _ )( _ \( ___)( \/ )( _ )(_ _)( _ \
( (__ )(_)( )(_) ))__) \ / )(_)( _)(_ )(_) )
\___)(_____)(____/(____) \/ (_____)(____)(____/
'
printf " OS: %s" "$OS"
printf " Version: %s" "$OSVER"
printf " Architecture: %s\n" "$OSARCH"
printf " CPU: %s\n" "${CPUS}x $CPUMODEL"
printf " SPEED: %s" "${CPUSPEED}Mhz"
printf " Memory: %s\n\n" "${MEM}MB"
printf " Interfaces:\n %s\n\n" "$INET"
printf " Welcome to $(hostname)\n\n"