Change message of the day

This commit is contained in:
waal70
2025-10-12 15:12:24 +02:00
parent 70ebfadeb9
commit c25ef79674
18 changed files with 1001 additions and 96 deletions

View File

@@ -2,6 +2,31 @@
- name: Prepare a custom motd, but do not affect 'proxmox_servers' - name: Prepare a custom motd, but do not affect 'proxmox_servers'
when: "'proxmox_servers' not in group_names" when: "'proxmox_servers' not in group_names"
block: block:
- name: Install large font for use in motd
ansible.builtin.apt:
name:
- toilet
state: present
cache_valid_time: 3600
- name: Check presence of ivrit.flf. If not present, nuke the motd.d directory
ansible.builtin.stat:
path: "/etc/update-motd.d/ivrit.flf"
register: fontpresence
- name: Delete motd when ivrit.flf not found
ansible.builtin.file:
state: absent
path: "/etc/update-motd.d/"
when: not fontpresence.stat.exists
- name: Recreate motd when ivrit.flf was not there
ansible.builtin.file:
state: directory
path: "/etc/update-motd.d/"
mode: "755"
when: not fontpresence.stat.exists
- name: Set a custom motd for all Debian-based systems # noqa: deprecated-bare-vars - name: Set a custom motd for all Debian-based systems # noqa: deprecated-bare-vars
ansible.builtin.template: ansible.builtin.template:
src: "{{ item.src }}" src: "{{ item.src }}"

View File

@@ -0,0 +1,10 @@
#!/bin/bash
# motd inspired on https://github.com/NeonWizard/spookdev-motd
source /etc/update-motd.d/colors.txt
echo -e; toilet -d /etc/update-motd.d/ -f ivrit -W -F border --gay $(hostname)
echo ""
echo -e "${NC} System is running ${TEXT_COLOR}$(lsb_release -ds)${NC}, managed by ${TEXT_COLOR}Ansible"
echo ""

View File

@@ -0,0 +1,7 @@
#!/bin/bash
source /etc/update-motd.d/colors.txt
echo -e " ${TITLE_COLOR}Users logged in.....:${NC} ${TEXT_COLOR}$(w -h | awk '{ printf "%s ", $1; }') $(top -bn1 | awk 'BEGIN { FS=", "; }
$2~/user/ { print " (" $2 " total)"; }
$3~/user/ { print " (" $3 " total)"; }')"

View File

@@ -0,0 +1,5 @@
#!/bin/bash
source /etc/update-motd.d/colors.txt
echo -e " ${TITLE_COLOR}Uptime..............:${NC} ${TEXT_COLOR}$(uptime -p | sed 's/^up.//')${NC}"

View File

@@ -0,0 +1,5 @@
#!/bin/bash
source /etc/update-motd.d/colors.txt
echo -e " ${TITLE_COLOR}Load Averages.......:${DEFAULT_COLOR} 1 min: ${TEXT_COLOR}$(cat /proc/loadavg | cut -f1 -d' ')%${DEFAULT_COLOR} | 5 mins: ${TEXT_COLOR}$(cat /proc/loadavg | cut -f2 -d' ')%${DEFAULT_COLOR} | 15 mins: ${TEXT_COLOR}$(cat /proc/loadavg | cut -f3 -d' ')%${NC}"

View File

@@ -0,0 +1,5 @@
#!/bin/bash
source /etc/update-motd.d/colors.txt
echo -e " ${TITLE_COLOR}Memory..............:${DEFAULT_COLOR} ${NC}Used: ${TEXT_COLOR}$(free -m | grep Mem: | xargs | cut -f3 -d' ')${DEFAULT_COLOR} ${NC}MB | ${NC}Free: ${TEXT_COLOR}$(free -m | grep Mem: | xargs | cut -f7 -d' ')${DEFAULT_COLOR} ${NC}MB | ${NC}Total: ${TEXT_COLOR}$(free -m | grep Mem: | xargs | cut -f2 -d' ')${DEFAULT_COLOR} ${NC}MB"

View File

@@ -0,0 +1,9 @@
#!/bin/bash
source /etc/update-motd.d/colors.txt
AVAIL="$(df --output=avail -h / | tail -1 | xargs)"
USED="$(df --output=used -h / | tail -1 | xargs)"
TOTAL="$(df --output=size -h / | tail -1 | xargs)"
echo -e " ${TITLE_COLOR}Disk................:${NC} Used: ${TEXT_COLOR}$(echo $USED | sed s/[A-Z]*//g)${NC} $(echo $USED | sed s/[^a-zA-Z]*//g)B | Free: ${TEXT_COLOR}$(echo $AVAIL | sed s/[A-Z]*//g)${NC} $(echo $AVAIL | sed s/[^a-zA-Z]*//g)B | Total: ${TEXT_COLOR}$(echo $TOTAL | sed s/[A-Z]*//g)${NC} $(echo $TOTAL | sed s/[^a-zA-Z]*//g)B"

View File

@@ -0,0 +1,5 @@
#!/bin/bash
source /etc/update-motd.d/colors.txt
echo -e " ${TITLE_COLOR}SSH Logins..........:${DEFAULT_COLOR} ${TEXT_COLOR}$(who | wc -l)${DEFAULT_COLOR} users logged in"

View File

@@ -0,0 +1,5 @@
#!/bin/bash
source /etc/update-motd.d/colors.txt
echo -e " ${TITLE_COLOR}Processes...........:${NC} ${TEXT_COLOR}$(ps -ef | wc -l)${DEFAULT_COLOR} running processes"

View File

@@ -0,0 +1,14 @@
#!/bin/bash
###############################################################
# Script : 09-ipaddresses
# Author : Andre
# Date : 16/07/2024
# Description: displays ipv4 and ipv6 addresses
# Args : none
###############################################################
source /etc/update-motd.d/colors.txt
echo -e " ${TITLE_COLOR}IPv4 addresses......:${NC} ${TEXT_COLOR}$(ip -h -br -c -4 a | awk '{ printf " %s:%s", $1, $3;}')"
echo -e " ${TITLE_COLOR}IPv6 addresses......:${NC} ${TEXT_COLOR}$(ip -h -br -c -6 a | awk '{ printf " %s:%s", $1, $3;}')"

View File

@@ -1,15 +0,0 @@
#!/bin/sh
###############################################################
# Script : 11-welcome
# Author : Petr Všetečka, Andre
# Email : vsetecka@cesnet.cz
# Date : 27/11/2018, 16/07/2024
# Description: prints distro name and kernel version
# Args : none
###############################################################
printf "\nSystem managed by Ansible"
printf "\nWelcome to "; lsb_release -ds
printf " System: "; uname -snrvm

View File

@@ -1,13 +0,0 @@
#!/bin/sh
###############################################################
# Script : 13-uptime
# Author : Petr Všetečka
# Email : vsetecka@cesnet.cz
# Date : 27/11/2018
# Description: prints total uptime in nice format
# Args : none
###############################################################
printf "System is "; uptime -p

View File

@@ -1,31 +0,0 @@
#!/bin/sh
###############################################################
# Script : 15-hwstats
# Author : Petr Všetečka
# Email : vsetecka@cesnet.cz
# Date : 27/11/2018
# Description: prints current time and usage of CPU, RAM & HDD
# Args : none
###############################################################
printf "\nSystem information as of "; date
printf "\n"
# CPU
printf " CPU load: "; cat /proc/loadavg | awk '{ printf "%s %s %s", $1, $2, $3; }'
printf " ("
printf $(($(ps -e --no-headers | wc -l) - 1))
printf " processes)\n"
# RAM
free -m | awk '/Mem/ { printf " Memory: %4sM (%2d%%) out of %2.1fG\n", $3, ($3/$2) * 100, $2/1000; }
/Swap/ {
if ( $3 == 0 )
printf " Swap: not available\n";
else
printf " Swap: %4sM (%2d%%) out of %2.1fG\n", $3, ($3/$2) * 100, $2/1000;
}'
# Disk
df -h | awk '/^\// { printf " Disk: %5s (%3s) out of %4s\n", $3, $5, $2; }'

View File

@@ -1,18 +0,0 @@
#!/bin/sh
###############################################################
# Script : 17-users
# Author : Petr Všetečka
# Email : vsetecka@cesnet.cz
# Date : 27/11/2018
# Description: prints names of all users currently logged in
# Args : none
###############################################################
printf "\n"
w -h | awk 'BEGIN { printf "Users logged in:"; }
{ printf " %s", $1; }'
top -bn1 | awk 'BEGIN { FS=", "; }
$2~/user/ { print " (" $2 " total)"; }
$3~/user/ { print " (" $3 " total)"; }'

View File

@@ -1,19 +0,0 @@
#!/bin/sh
###############################################################
# Script : 19-ipaddresses
# Author : Andre
# Date : 16/07/2024
# Description: displays ipv4 and ipv6 addresses
# Args : none
###############################################################
printf "\n"
printf "IPv4 addresses\n"
printf "===============================================================================\n"
ip -h -br -f inet a
printf "===============================================================================\n"
printf "IPv6 addresses\n"
ip -h -br -f inet6 a
printf "===============================================================================\n"

View File

@@ -0,0 +1,5 @@
#!/bin/bash
echo ""
echo -e "${NC} UTC: ${TEXT_COLOR}$(date -u)${NC}, local: ${TEXT_COLOR}$(date)"
echo ""

View File

@@ -0,0 +1,6 @@
NC='\033[0m'
DEFAULT_COLOR='\e[38;5;34m'
TEXT_COLOR='\e[38;5;83m'
TITLE_COLOR='\e[38;5;11m'
#YELLOW_COLOR='\e[38;5;11m'
#RED_COLOR='\e[38;5;196m'

View File

@@ -0,0 +1,900 @@
flf2a$ 6 5 76 15 14 1 16271
Ivrit (Hebrew) Unicode font assembled by John Cowan <cowan@ccil.org>
Latin chars from Standard by G. Chappell & Ian Chai
Hebrew chars from Jerusalem by Gedaliah Friedenberg <gfrieden@nyx.cs.du.edu>
Use "ilhebrew.flc" for Hebrew keyboard mapping
Use "ushebrew.flc" for U.S.-style keyboard mapping ("febrew" script)
Use "8859-8.flc" for ISO 8859-8 text
Or use UTF-8
WARNING! FIGfonts aren't bidirectional; this is strictly right-to-left
(by default) even for the Latin characters.
figlet release 2.2 -- November 1996
Modified by Paul Burton <solution@earthlink.net> 12/96 to include new parameter
supported by FIGlet and FIGWin. May also be slightly modified for better use
of new full-width/kern/smush alternatives, but default output is NOT changed.
$@
$@
$@
$@
$@
$@@
_ @
| |@
| |@
|_|@
(_)@
@@
_ _ @
( | )@
V V @
$ @
$ @
@@
_ _ @
_| || |_ @
|_ .. _|@
|_ _|@
|_||_| @
@@
_ @
| | @
/ __)@
\__ \@
( /@
|_| @@
_ __@
(_)/ /@
/ / @
/ /_ @
/_/(_)@
@@
___ @
( _ ) @
/ _ \/\@
| (_> <@
\___/\/@
@@
_ @
( )@
|/ @
$ @
$ @
@@
__@
/ /@
| | @
| | @
| | @
\_\@@
__ @
\ \ @
| |@
| |@
| |@
/_/ @@
@
__/\__@
\ /@
/_ _\@
\/ @
@@
@
_ @
_| |_ @
|_ _|@
|_| @
@@
@
@
@
_ @
( )@
|/ @@
@
@
_____ @
|_____|@
$ @
@@
@
@
@
_ @
(_)@
@@
__@
/ /@
/ / @
/ / @
/_/ @
@@
___ @
/ _ \ @
| | | |@
| |_| |@
\___/ @
@@
_ @
/ |@
| |@
| |@
|_|@
@@
____ @
|___ \ @
__) |@
/ __/ @
|_____|@
@@
_____ @
|___ / @
|_ \ @
___) |@
|____/ @
@@
_ _ @
| || | @
| || |_ @
|__ _|@
|_| @
@@
____ @
| ___| @
|___ \ @
___) |@
|____/ @
@@
__ @
/ /_ @
| '_ \ @
| (_) |@
\___/ @
@@
_____ @
|___ |@
/ / @
/ / @
/_/ @
@@
___ @
( _ ) @
/ _ \ @
| (_) |@
\___/ @
@@
___ @
/ _ \ @
| (_) |@
\__, |@
/_/ @
@@
@
_ @
(_)@
_ @
(_)@
@@
@
_ @
(_)@
_ @
( )@
|/ @@
__@
/ /@
/ / @
\ \ @
\_\@
@@
@
_____ @
|_____|@
|_____|@
$ @
@@
__ @
\ \ @
\ \@
/ /@
/_/ @
@@
___ @
|__ \@
/ /@
|_| @
(_) @
@@
____ @
/ __ \ @
/ / _` |@
| | (_| |@
\ \__,_|@
\____/ @@
_ @
/ \ @
/ _ \ @
/ ___ \ @
/_/ \_\@
@@
____ @
| __ ) @
| _ \ @
| |_) |@
|____/ @
@@
____ @
/ ___|@
| | @
| |___ @
\____|@
@@
____ @
| _ \ @
| | | |@
| |_| |@
|____/ @
@@
_____ @
| ____|@
| _| @
| |___ @
|_____|@
@@
_____ @
| ___|@
| |_ @
| _| @
|_| @
@@
____ @
/ ___|@
| | _ @
| |_| |@
\____|@
@@
_ _ @
| | | |@
| |_| |@
| _ |@
|_| |_|@
@@
___ @
|_ _|@
| | @
| | @
|___|@
@@
_ @
| |@
_ | |@
| |_| |@
\___/ @
@@
_ __@
| |/ /@
| ' / @
| . \ @
|_|\_\@
@@
_ @
| | @
| | @
| |___ @
|_____|@
@@
__ __ @
| \/ |@
| |\/| |@
| | | |@
|_| |_|@
@@
_ _ @
| \ | |@
| \| |@
| |\ |@
|_| \_|@
@@
___ @
/ _ \ @
| | | |@
| |_| |@
\___/ @
@@
____ @
| _ \ @
| |_) |@
| __/ @
|_| @
@@
___ @
/ _ \ @
| | | |@
| |_| |@
\__\_\@
@@
____ @
| _ \ @
| |_) |@
| _ < @
|_| \_\@
@@
____ @
/ ___| @
\___ \ @
___) |@
|____/ @
@@
_____ @
|_ _|@
| | @
| | @
|_| @
@@
_ _ @
| | | |@
| | | |@
| |_| |@
\___/ @
@@
__ __@
\ \ / /@
\ \ / / @
\ V / @
\_/ @
@@
__ __@
\ \ / /@
\ \ /\ / / @
\ V V / @
\_/\_/ @
@@
__ __@
\ \/ /@
\ / @
/ \ @
/_/\_\@
@@
__ __@
\ \ / /@
\ V / @
| | @
|_| @
@@
_____@
|__ /@
/ / @
/ /_ @
/____|@
@@
__ @
| _|@
| | @
| | @
| | @
|__|@@
__ @
\ \ @
\ \ @
\ \ @
\_\@
@@
__ @
|_ |@
| |@
| |@
| |@
|__|@@
/\ @
|/\|@
$ @
$ @
$ @
@@
@
@
@
@
_____ @
|_____|@@
_ @
( )@
\|@
$ @
$ @
@@
@
__ _ @
/ _` |@
| (_| |@
\__,_|@
@@
_ @
| |__ @
| '_ \ @
| |_) |@
|_.__/ @
@@
@
___ @
/ __|@
| (__ @
\___|@
@@
_ @
__| |@
/ _` |@
| (_| |@
\__,_|@
@@
@
___ @
/ _ \@
| __/@
\___|@
@@
__ @
/ _|@
| |_ @
| _|@
|_| @
@@
@
__ _ @
/ _` |@
| (_| |@
\__, |@
|___/ @@
_ @
| |__ @
| '_ \ @
| | | |@
|_| |_|@
@@
_ @
(_)@
| |@
| |@
|_|@
@@
_ @
(_)@
| |@
| |@
_/ |@
|__/ @@
_ @
| | __@
| |/ /@
| < @
|_|\_\@
@@
_ @
| |@
| |@
| |@
|_|@
@@
@
_ __ ___ @
| '_ ` _ \ @
| | | | | |@
|_| |_| |_|@
@@
@
_ __ @
| '_ \ @
| | | |@
|_| |_|@
@@
@
___ @
/ _ \ @
| (_) |@
\___/ @
@@
@
_ __ @
| '_ \ @
| |_) |@
| .__/ @
|_| @@
@
__ _ @
/ _` |@
| (_| |@
\__, |@
|_|@@
@
_ __ @
| '__|@
| | @
|_| @
@@
@
___ @
/ __|@
\__ \@
|___/@
@@
_ @
| |_ @
| __|@
| |_ @
\__|@
@@
@
_ _ @
| | | |@
| |_| |@
\__,_|@
@@
@
__ __@
\ \ / /@
\ V / @
\_/ @
@@
@
__ __@
\ \ /\ / /@
\ V V / @
\_/\_/ @
@@
@
__ __@
\ \/ /@
> < @
/_/\_\@
@@
@
_ _ @
| | | |@
| |_| |@
\__, |@
|___/ @@
@
____@
|_ /@
/ / @
/___|@
@@
__@
/ /@
| | @
< < @
| | @
\_\@@
_ @
| |@
| |@
| |@
| |@
|_|@@
__ @
\ \ @
| | @
> >@
| | @
/_/ @@
/\/|@
|/\/ @
$ @
$ @
$ @
@@
_ _ @
(_)_(_)@
/_\ @
/ _ \ @
/_/ \_\@
@@
_ _ @
(_)_(_)@
/ _ \ @
| |_| |@
\___/ @
@@
_ _ @
(_) (_)@
| | | |@
| |_| |@
\___/ @
@@
_ _ @
(_)_(_)@
/ _` |@
| (_| |@
\__,_|@
@@
_ _ @
(_)_(_)@
/ _ \ @
| (_) |@
\___/ @
@@
_ _ @
(_) (_)@
| | | |@
| |_| |@
\__,_|@
@@
___ @
/ _ \@
| |/ /@
| |\ \@
| ||_/@
|_| @@
160 NO-BREAK SPACE
$@
$@
$@
$@
$@
$@@
173 SOFT HYPHEN
@
@
_____ @
|_____|@
$ @
@@
196 LATIN CAPITAL LETTER A WITH DIAERESIS
_ _ @
(_)_(_)@
/_\ @
/ _ \ @
/_/ \_\@
@@
214 LATIN CAPITAL LETTER O WITH DIAERESIS
_ _ @
(_)_(_)@
/ _ \ @
| |_| |@
\___/ @
@@
220 LATIN CAPITAL LETTER U WITH DIAERESIS
_ _ @
(_) (_)@
| | | |@
| |_| |@
\___/ @
@@
223 LATIN SMALL LETTER SHARP S
___ @
/ _ \@
| |/ /@
| |\ \@
| ||_/@
|_| @@
228 LATIN SMALL LETTER A WITH DIAERESIS
_ _ @
(_)_(_)@
/ _` |@
| (_| |@
\__,_|@
@@
246 LATIN SMALL LETTER O WITH DIAERESIS
_ _ @
(_)_(_)@
/ _ \ @
| (_) |@
\___/ @
@@
252 LATIN SMALL LETTER U WITH DIAERESIS
_ _ @
(_) (_)@
| | | |@
| |_| |@
\__,_|@
@@
0x05D0 HEBREW LETTER ALEF
__ __@
\ \ / /@
| V / @
| |\ \ @
|_| \_\@
@@
0x05D1 HEBREW LETTER BET
______ @
|____ | @
| | @
_____| |_@
/________/@
@@
0x05D2 HEBREW LETTER GIMEL
____ @
|__ | @
| | @
____| | @
/____/\_\@
@@
0x05D3 HEBREW LETTER DALET
_______ @
|____ |@
| | @
| | @
|_| @
@@
0x05D4 HEBREW LETTER HE
_______ @
|_____ |@
_ | |@
| | | |@
|_| |_|@
@@
0x05D5 HEBREW LETTER VAV
___ @
|_ |@
| |@
| |@
|_|@
@@
0x05D6 HEBREW LETTER ZAYIN
________ @
\__ __\@
| | @
| | @
|_| @
@@
0x05D7 HEBREW LETTER HET
_______ @
|. __ |@
| | | |@
| | | |@
|_| |_|@
@@
0x05D8 HEBREW LETTER TET
__ ___ @
|. | /_ |@
| | | |@
| |___| |@
|_______|@
@@
0x05D9 HEBREW LETTER YOD
___ @
|_ |@
|_|@
$ @
$ @
@@
0x05DA HEBREW LETTER FINAL KAF
_______ @
|____ .|@
| | @
| | @
| | @
|_| @@
0x05DB HEBREW LETTER KAF
_____ @
|____ \ @
| |@
____| |@
|_____/ @
@@
0x05DC HEBREW LETTER LAMED
|=|____ @
|____ |@
/ / @
/ / @
/_/ @
@@
0x05DD HEBREW LETTER FINAL MEM
________ @
|. ___ |@
| | | |@
| |___| |@
|_______|@
@@
0x05DE HEBREW LETTER MEM
_______ @
|. __ |@
| | | |@
| | _| |@
|_||___|@
@@
0x05DF HEBREW LETTER FINAL NUN
___ @
|_ |@
| |@
| |@
| |@
|_|@@
0x05E0 HEBREW LETTER NUN
___ @
|_ |@
| |@
__| |@
|____|@
@@
0x05E1 HEBREW LETTER SAMEKH
_______ @
|. __ |@
| | | |@
| |__/ |@
|_____/ @
@@
0x05E2 HEBREW LETTER AYIN
__ _ @
\ \ | |@
\ \| |@
__\ ` |@
|______|@
@@
0x05E3 HEBREW LETTER FINAL PE
______ @
| __ |@
| |_ | |@
|___|| |@
| |@
|_|@@
0x05E4 HEBREW LETTER PE
_______ @
| ___ |@
\_\ | |@
_____| |@
|_______|@
@@
0x05E5 HEBREW LETTER FINAL TSADI
__ _ @
|. | | |@
| | // @
| |// @
| | @
|_| @@
0x05E6 HEBREW LETTER TSADI
__ __.@
\ \ / / @
\ V / @
___\ \ @
|______| @
@@
0x05E7 HEBREW LETTER QOF
______ @
|____ |@
_ | |@
| | |_|@
| | @
|_| @@
0x05E8 HEBREW LETTER RESH
______ @
|____ |@
| |@
| |@
|_|@
@@
0x05E9 HEBREW LETTER SHIN
_ _ _ @
| | | | | |@
| | | | | |@
| |/ /_/ / @
|_______/ @
@@
0x05EA HEBREW LETTER TAV
______ @
| __ |@
| | | |@
_| | | |@
|___| |_|@
@@
0x2721 STAR OF DAVID
@
__/\__@
\ /@
/_ _\@
\/ @
@@
-0x0002
aleph = t, bet/vet = c, gimel = d, dalet = s, he = v, vav = u, zayin = z @
het = j, tet = y, yod = h, kaf/chaf = f, final kaf = l, lamed = k, mem = n@
final mem = o, nun = b, final nun = i, samekh = x, ayin = g, pe/fe = p, @
final pe = ;, tsadi = m, final tsadi = ., qof = e, resh = r, shin/sin = a @
tav = , comma = ', period = /, semicolon = `, slash = q, apostrophe = w @
Star of David = * @@
-0x0003
aleph = a, bet/vet = b, gimel = g, dalet = d, he = h, vav = v, zayin = z @
het = c, tet = t, yod = y, kaf/chaf = k, final kaf = f, lamed = l, mem = m@
final mem = o, nun = n, final nun = i, samekh = e, ayin = _, pe/fe = p, @
final pe = u, tsadi = j, final tsadi = w, qof = q, resh = r, shin/sin = s @
tav = x @
Star of David = * @@