add custom motd for reboot detection

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Ludovic Cartier
2026-05-04 18:59:57 +02:00
parent 034d83ece3
commit ca9f50fa1c
3 changed files with 26 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
# /etc/update-motd.d/99-reboot-required
if [ -f /run/reboot-required ]; then
RED_BOLD='\033[1;31m'
RESET='\033[0m'
printf '\n%b[!] REBOOT REQUIRED [!]%b\n' "$RED_BOLD" "$RESET"
if [ -r /run/reboot-required.pkgs ]; then
printf 'Packages requiring reboot:\n'
cat /run/reboot-required.pkgs
fi
printf '\n'
fi
+4
View File
@@ -28,3 +28,7 @@
- name: base | set datetime
import_tasks: datetime.yml
tags: [ 'datetime', 'date', 'ntp' ]
- name: base | configure motd
import_tasks: motd.yml
tags: [ 'motd' ]
+6
View File
@@ -0,0 +1,6 @@
---
- name: motd | copy reboot required script
copy:
src: 99-reboot-required
dest: /etc/update-motd.d/99-reboot-required
mode: '0755'