Skip to content

Commit 226b1c9

Browse files
committed
Added Clearlinux banner
1 parent 6d13100 commit 226b1c9

File tree

4 files changed

+72
-1
lines changed

4 files changed

+72
-1
lines changed

rootfs/clearlinux/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ RUN source /usr/lib/os-release; \
1414
--path /install_root --statedir /swupd-state \
1515
--no-boot-update; \
1616
cd /install_root/etc; \
17-
ln -s ../usr/lib/os-release os-release
17+
ln -s ../usr/lib/os-release os-release; \
18+
cat os-release | grep PRETTY_NAME | awk -F= '{print $2;}' | awk '{ gsub(/"/, ""); print }' > system-release ;
1819

1920
FROM scratch AS system-build2
2021
#
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
#
3+
# Author: Bala Raman <srbala@gmail.com>
4+
# /usr/local/bin/print-sys-info
5+
#
6+
# source print-sys-info
7+
sys-banner
8+
sys-info
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
#
3+
# Author: Bala Raman <srbala@gmail.com>
4+
# /usr/local/bin/sys-banner
5+
#
6+
echo "
7+
____ _ _ _
8+
/ ___| | ___ __ _ _ __| (_)_ __ _ ___ __
9+
| | | |/ _ \/ _' | '__| | | '_ \| | | \ \/ /
10+
| |___| | __/ (_| | | | | | | | | |_| |> <
11+
\____|_|\___|\__,_|_| |_|_|_| |_|\__,_/_/\_\
12+
"
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
#
3+
# Author: Bala Raman <srbala@gmail.com>
4+
# /usr/local/bin/sys-info
5+
#
6+
TCPU=`lscpu | grep "Model name" | awk -F: '{print $2;}' | awk '{ sub(/^[ \t]+/, ""); print }'`
7+
MEMORY1=`free -t -m | grep "Mem" | awk '{print $4" MB";}'`
8+
MEMORY2=`free -t -m | grep "Mem" | awk '{print $2" MB";}'`
9+
MEMORY3=`free -t -m | grep "Swap" | awk '{print $4" MB";}'`
10+
MEMORY4=`free -t -m | grep "Swap" | awk '{print $2" MB";}'`
11+
PSA=`ps -Afl | wc -l`
12+
13+
# time of day
14+
HOUR=$(date +"%H")
15+
if [ $HOUR -lt 12 -a $HOUR -ge 0 ]
16+
then TIME="morning"
17+
elif [ $HOUR -lt 17 -a $HOUR -ge 12 ]
18+
then TIME="afternoon"
19+
else
20+
TIME="evening"
21+
fi
22+
23+
#System uptime
24+
uptime=`cat /proc/uptime | cut -f1 -d.`
25+
upDays=$((uptime/60/60/24))
26+
upHours=$((uptime/60/60%24))
27+
upMins=$((uptime/60%60))
28+
upSecs=$((uptime%60))
29+
30+
#System load
31+
LOAD1=`cat /proc/loadavg | awk {'print $1'}`
32+
LOAD5=`cat /proc/loadavg | awk {'print $2'}`
33+
LOAD15=`cat /proc/loadavg | awk {'print $3'}`
34+
35+
echo "
36+
Good $TIME `whoami`!
37+
===============================================================================
38+
- Hostname............: `uname -n`
39+
- Release.............: `cat /etc/system-release`
40+
===============================================================================
41+
- Current user........: `whoami`
42+
- CPU Model...........: $TCPU
43+
- CPU usage...........: $LOAD1, $LOAD5, $LOAD15 (1, 5, 15 min)
44+
- Memory free/total...: $MEMORY1 / $MEMORY2
45+
- Swap free/total.....: $MEMORY3 / $MEMORY4
46+
- Kernel..............: `uname -r`
47+
- Processes...........: $PSA running
48+
- System uptime.......: $upDays days $upHours hours $upMins minutes $upSecs seconds
49+
===============================================================================
50+
"

0 commit comments

Comments
 (0)