conform motd to 80x24
This commit is contained in:
parent
a0452bf4f9
commit
9bb45cd61b
34
files/etc/dynmotd
Normal file
34
files/etc/dynmotd
Normal 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}
|
||||||
|
"
|
||||||
|
|
@ -1,34 +1,15 @@
|
|||||||
#!/bin/bash
|
.:^~~~~^:. _____ _
|
||||||
RED=$(tput setaf 1)
|
.^!?JJJJJJJJJJ?!^. | __ \ | |
|
||||||
GREEN=$(tput setaf 2)
|
~?JJJJJJJJJJJJJJJJ?~ | |__) |___ ___| | ___ _
|
||||||
YELLOW=$(tput setaf 3)
|
:?JJJJJJJJJJJJJJJJJJJJ?: | _ // _ \ / __| |/ / | | |
|
||||||
BLUE=$(tput setaf 4)
|
.?JJJJJJJJJJJJJJ7?JJJJJJ?. | | \ \ (_) | (__| <| |_| |
|
||||||
MAGENTA=$(tput setaf 5)
|
!JJJJJJJJJJJJJ7: ^?JJJJJ! |_| \_\___/ \___|_|\_\\__, |
|
||||||
CYAN=$(tput setaf 6)
|
7JJJJJJJJJJJ!: ^7JJJ7 _ _ __/ |
|
||||||
WHITE=$(tput setaf 7)
|
!JJJJJJJJJ!. :. :7J! | | (_) |___/
|
||||||
RESET=$(tput sgr0)
|
.?JJJJJ?~. :7JJ!. :. | | _ _ __ _ ___ __
|
||||||
BOLD=$(tput bold)
|
:?JJ?~. ^7JJJJJJ!: | | | | '_ \| | | \ \/ /
|
||||||
|
.~~ ^?JJJJJJJJY?: | |____| | | | | |_| |> <
|
||||||
uptime=`cat /proc/uptime | cut -f1 -d.`
|
^?YYJJJJJJ?!^. |______|_|_| |_|\__,_/_/\_\
|
||||||
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}
|
|
||||||
"
|
|
||||||
|
|
||||||
|
We hope you enjoy your stay.
|
||||||
|
@ -47,6 +47,9 @@
|
|||||||
- name: Configure common scripts
|
- name: Configure common scripts
|
||||||
ansible.builtin.import_tasks: tasks/scripts.yml
|
ansible.builtin.import_tasks: tasks/scripts.yml
|
||||||
|
|
||||||
|
- name: Configure motd and banners
|
||||||
|
ansible.builtin.import_tasks: tasks/banners.yml
|
||||||
|
|
||||||
- name: Configure common skel items
|
- name: Configure common skel items
|
||||||
ansible.builtin.import_tasks: tasks/skel.yml
|
ansible.builtin.import_tasks: tasks/skel.yml
|
||||||
|
|
||||||
|
9
tasks/banners.yml
Normal file
9
tasks/banners.yml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
- name: Default motd banner
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: "etc/motd"
|
||||||
|
dest: "/etc/motd"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
...
|
Loading…
Reference in New Issue
Block a user