Last active
April 29, 2022 08:14
-
-
Save megrxu/b9a29908ec56af4a4a6fcf70ef7a296f to your computer and use it in GitHub Desktop.
Message of one day.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#define the filename to use as output | |
motd="/tmp/motd" | |
# Collect useful information about your system | |
# $USER is automatically defined | |
HOSTNAME=`uname -n` | |
KERNEL=`uname -r` | |
CPU=`cat /proc/cpuinfo | grep 'model name' | uniq | cut -f2 -d":"` | |
ARCH=`uname -m` | |
# The different colours as variables | |
W="\033[01;37m" | |
B="\033[01;36m" | |
R="\033[01;31m" | |
X="\033[00;37m" | |
clear > $motd # to clear the screen when showing up | |
echo -e "$R#=============================================================================#" >> $motd | |
echo -e " $W Welcome $B $USER $W to $B $HOSTNAME " >> $motd | |
echo -e " $R ARCH $W= $ARCH " >> $motd | |
echo -e " $R KERNEL $W= $KERNEL " >> $motd | |
echo -e " $R CPU $W=$CPU " >> $motd | |
echo -e " $R Uptime $W= $(uptime -p) " >> $motd | |
echo -e "$R#=============================================================================#" >> $motd | |
echo -e "$X" >> $motd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment