-
Notifications
You must be signed in to change notification settings - Fork 1
/
00-x86-header
executable file
·29 lines (28 loc) · 988 Bytes
/
00-x86-header
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# depends: figlet toilet
UNAME_R=$(uname -r)
UNAME_V=$(uname -v | sed 's/ SMP//g' | sed 's/ PREEMPT//g' | sed 's/PREEMPT_DYNAMIC //g')
UNAME_M=$(uname -m)
# Ubuntu
if [[ -f "/etc/lsb-release" ]]; then
[ -r /etc/lsb-release ] && . /etc/lsb-release
if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then
# Fall back to using the very slow lsb_release utility
DISTRIB_DESCRIPTION=$(lsb_release -s -d)
fi
HEADER=$(printf "%s (%s %s %s)\n" "$DISTRIB_DESCRIPTION" "$UNAME_R" "$UNAME_V" "$UNAME_M")
figlet -c -f term $HEADER
else
# Debian / Devuan
if [[ -f "/etc/os-release" ]]; then
[ -r /etc/os-release ] && . /etc/os-release
if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then
# Fall back to using the very slow lsb_release utility
DISTRIB_DESCRIPTION=$(lsb_release -s -d)
fi
HEADER=$(printf "%s %s %s %s\n" "$DISTRIB_DESCRIPTION" "$UNAME_R" "$UNAME_V" "$UNAME_M")
figlet -c -f term $HEADER
else
uname -snrvm
fi
fi