conform motd to 80x24

This commit is contained in:
Louis Abel 2023-04-22 01:24:19 -07:00
parent a0452bf4f9
commit 9bb45cd61b
Signed by: label
GPG Key ID: 6735C0E1BD65D048
4 changed files with 59 additions and 32 deletions

34
files/etc/dynmotd Normal file
View File

@ -0,0 +1,34 @@
#!/bin/bash
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5)
CYAN=$(tput setaf 6)
WHITE=$(tput setaf 7)
RESET=$(tput sgr0)
BOLD=$(tput bold)
uptime=`cat /proc/uptime | cut -f1 -d.`
upDays=$((uptime/60/60/24))
upHours=$((uptime/60/60%24))
upMins=$((uptime/60%60))
upSecs=$((uptime%60))
echo -e "${GREEN}
.:^~~~~^:. ${RESET}$(hostname)${GREEN}
.^!?JJJJJJJJJJ?!^. -------------------------------------------------
~?JJJJJJJJJJJJJJJJ?~ ${RESET}$(cat /etc/redhat-release)${GREEN}
:?JJJJJJJJJJJJJJJJJJJJ?: ${RESET}Uptime: ${BOLD}$upDays days $upHours hours $upMins minutes $upSecs seconds${GREEN}
.?JJJJJJJJJJJJJJ7?JJJJJJ?.
!JJJJJJJJJJJJJ7: ^?JJJJJ!
7JJJJJJJJJJJ!: ^7JJJ7
!JJJJJJJJJ!. :. :7J!
.?JJJJJ?~. :7JJ!. :.
:?JJ?~. ^7JJJJJJ!:
.~~ ^?JJJJJJJJY?:
^?YYJJJJJJ?!^.
.:^~~~~^:.
${RESET}
"

View File

@ -1,34 +1,15 @@
#!/bin/bash
RED=$(tput setaf 1)
GREEN=$(tput setaf 2)
YELLOW=$(tput setaf 3)
BLUE=$(tput setaf 4)
MAGENTA=$(tput setaf 5)
CYAN=$(tput setaf 6)
WHITE=$(tput setaf 7)
RESET=$(tput sgr0)
BOLD=$(tput bold)
uptime=`cat /proc/uptime | cut -f1 -d.`
upDays=$((uptime/60/60/24))
upHours=$((uptime/60/60%24))
upMins=$((uptime/60%60))
upSecs=$((uptime%60))
echo -e "${GREEN}
.:^~~~~^:. ${RESET}$(hostname)${GREEN}
.^!?JJJJJJJJJJ?!^. -------------------------------------------------
~?JJJJJJJJJJJJJJJJ?~ ${RESET}$(cat /etc/redhat-release)${GREEN}
:?JJJJJJJJJJJJJJJJJJJJ?: ${RESET}Uptime: ${BOLD}$upDays days $upHours hours $upMins minutes $upSecs seconds${GREEN}
.?JJJJJJJJJJJJJJ7?JJJJJJ?.
!JJJJJJJJJJJJJ7: ^?JJJJJ!
7JJJJJJJJJJJ!: ^7JJJ7
!JJJJJJJJJ!. :. :7J!
.?JJJJJ?~. :7JJ!. :.
:?JJ?~. ^7JJJJJJ!:
.~~ ^?JJJJJJJJY?:
^?YYJJJJJJ?!^.
.:^~~~~^:. _____ _
.^!?JJJJJJJJJJ?!^. | __ \ | |
~?JJJJJJJJJJJJJJJJ?~ | |__) |___ ___| | ___ _
:?JJJJJJJJJJJJJJJJJJJJ?: | _ // _ \ / __| |/ / | | |
.?JJJJJJJJJJJJJJ7?JJJJJJ?. | | \ \ (_) | (__| <| |_| |
!JJJJJJJJJJJJJ7: ^?JJJJJ! |_| \_\___/ \___|_|\_\\__, |
7JJJJJJJJJJJ!: ^7JJJ7 _ _ __/ |
!JJJJJJJJJ!. :. :7J! | | (_) |___/
.?JJJJJ?~. :7JJ!. :. | | _ _ __ _ ___ __
:?JJ?~. ^7JJJJJJ!: | | | | '_ \| | | \ \/ /
.~~ ^?JJJJJJJJY?: | |____| | | | | |_| |> <
^?YYJJJJJJ?!^. |______|_|_| |_|\__,_/_/\_\
.:^~~~~^:.
${RESET}
"
We hope you enjoy your stay.

View File

@ -47,6 +47,9 @@
- name: Configure common scripts
ansible.builtin.import_tasks: tasks/scripts.yml
- name: Configure motd and banners
ansible.builtin.import_tasks: tasks/banners.yml
- name: Configure common skel items
ansible.builtin.import_tasks: tasks/skel.yml

9
tasks/banners.yml Normal file
View File

@ -0,0 +1,9 @@
---
- name: Default motd banner
ansible.builtin.copy:
src: "etc/motd"
dest: "/etc/motd"
owner: root
group: root
mode: '0644'
...