Use 'update_motd' in 'baseconfig'
This commit is contained in:
parent
7e92fdfab7
commit
b81600aef8
3 changed files with 2 additions and 51 deletions
|
@ -1,39 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
# {{ ansible_managed }}
|
|
||||||
|
|
||||||
# Pretty uptime
|
|
||||||
upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)"
|
|
||||||
mins=$((${upSeconds}/60%60))
|
|
||||||
hours=$((${upSeconds}/3600%24))
|
|
||||||
days=$((${upSeconds}/86400))
|
|
||||||
UPTIME=`printf "%d jours, %02dh%02dm" "$days" "$hours" "$mins"`
|
|
||||||
|
|
||||||
# RAM
|
|
||||||
RAM=`free -m | awk 'NR==2{printf "%s/%sMB (%.2f%%)\n", $3,$2,$3*100/$2 }'`
|
|
||||||
DISK=`df -h | awk '$NF=="/"{printf "%d/%dGB (%s)\n", $3,$2,$5}'`
|
|
||||||
|
|
||||||
# Text font
|
|
||||||
bold=$(tput bold)
|
|
||||||
normal=$(tput sgr0)
|
|
||||||
|
|
||||||
# Logo
|
|
||||||
cat << EOF
|
|
||||||
[49m[K[0m
|
|
||||||
[0m [48;5;160m[38;5;160m [48;5;124m[38;5;124m [48;5;160m[38;5;160m [0m [49m ${bold}Uptime${normal} : ${UPTIME}
|
|
||||||
[0m [48;5;160m[38;5;160m [0m [49m ${bold}Mémoire${normal} : ${RAM}
|
|
||||||
[0m [48;5;160m[38;5;160m [0m [48;5;231m[38;5;232m [0m [48;5;160m[38;5;160m [0m [49m ${bold}Disque racine${normal} : ${DISK}
|
|
||||||
[0m [48;5;160m[38;5;160m [0m [48;5;231m[38;5;232m [0m [48;5;160m[38;5;160m [0m [49m
|
|
||||||
[0m [48;5;160m[38;5;160m [48;5;124m[38;5;124m [48;5;160m[38;5;160m [0m [48;5;231m[38;5;232m [0m [48;5;160m[38;5;160m [48;5;52m[38;5;196m [0m [49m
|
|
||||||
[0m [48;5;124m[38;5;124m [0m [48;5;160m[38;5;160m [0m [48;5;231m[38;5;232m [0m [48;5;231m[38;5;232m [0m [48;5;160m[38;5;160m [0m [49m
|
|
||||||
[0m [48;5;160m[38;5;160m [0m [48;5;231m[38;5;232m [0m [48;5;231m[38;5;232m [0m [48;5;160m[38;5;160m [0m [48;5;124m[38;5;124m [0m[49m
|
|
||||||
[0m [48;5;124m[38;5;124m [48;5;160m[38;5;160m [0m [48;5;188m[38;5;188m [48;5;231m[38;5;232m [0m [48;5;231m[38;5;232m [0m [48;5;160m[38;5;160m [0m[49m
|
|
||||||
[0m [48;5;160m[38;5;160m [0m [48;5;160m[38;5;160m [48;5;231m[38;5;232m [0m [48;5;160m[38;5;160m [0m[49m
|
|
||||||
[0m [48;5;160m[38;5;160m [0m [48;5;160m[38;5;160m [48;5;231m[38;5;232m [0m [48;5;160m[38;5;160m [0m[49m
|
|
||||||
[0m [48;5;160m[38;5;160m [0m [48;5;231m[38;5;232m [0m [48;5;231m[38;5;232m [0m [48;5;160m[38;5;160m [0m [49m
|
|
||||||
[0m [48;5;160m[38;5;160m [0m [48;5;231m[38;5;232m [0m [48;5;231m[38;5;232m [0m [48;5;160m[38;5;160m [0m [49m
|
|
||||||
[0m [48;5;160m[38;5;160m [0m [48;5;231m[38;5;232m [0m [48;5;231m[38;5;232m [0m [48;5;160m[38;5;160m [0m [49m
|
|
||||||
[0m [48;5;124m[38;5;124m [0m [48;5;160m[38;5;160m [0m [48;5;231m[38;5;232m [0m [48;5;231m[38;5;232m [0m [48;5;160m[38;5;160m [0m [49m
|
|
||||||
[0m [48;5;160m[38;5;160m [0m [48;5;231m[38;5;232m [0m [48;5;231m[38;5;232m [48;5;160m[38;5;160m [0m [49m
|
|
||||||
[0m [48;5;160m[38;5;160m [0m ${bold}Aurore${normal} [48;5;231m[38;5;232m [48;5;160m[38;5;160m [0m [49m
|
|
||||||
|
|
||||||
EOF
|
|
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
# {{ ansible_managed }}
|
|
||||||
uname -snrvm
|
|
|
@ -32,15 +32,8 @@
|
||||||
retries: 3
|
retries: 3
|
||||||
until: apt_result is succeeded
|
until: apt_result is succeeded
|
||||||
|
|
||||||
# Pimp my server
|
- include_role:
|
||||||
- name: Customize motd
|
name: update_motd
|
||||||
copy:
|
|
||||||
src: "update-motd.d/{{ item }}"
|
|
||||||
dest: "/etc/update-motd.d/{{ item }}"
|
|
||||||
mode: 0755
|
|
||||||
loop:
|
|
||||||
- 00-logo
|
|
||||||
- 10-uname
|
|
||||||
|
|
||||||
- name: Remove Debian warranty motd
|
- name: Remove Debian warranty motd
|
||||||
file:
|
file:
|
||||||
|
|
Loading…
Reference in a new issue