From 15e0b8f4519a0a7cea3a2b9d8b0214dc4bad6694 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Mon, 18 Sep 2023 13:03:47 +0200 Subject: [PATCH] saving uncommitted changes in /etc prior to apt run --- .etckeeper | 4 ++++ cron.d/greetings | 4 ++-- update-motd.d/20-release | 9 +++++++++ update-motd.d/40-tail | 7 +++++++ update-motd.d/50-fortune | 13 +++++++++++++ update-motd.d/60-ddate | 9 +++++++++ 6 files changed, 44 insertions(+), 2 deletions(-) create mode 100755 update-motd.d/20-release create mode 100755 update-motd.d/40-tail create mode 100755 update-motd.d/50-fortune create mode 100755 update-motd.d/60-ddate diff --git a/.etckeeper b/.etckeeper index f8e6847..0366326 100755 --- a/.etckeeper +++ b/.etckeeper @@ -2663,6 +2663,10 @@ maybe chmod 0644 'ufw/applications.d/postfix' maybe chmod 0600 'ulogd.conf' maybe chmod 0755 'update-motd.d' maybe chmod 0755 'update-motd.d/10-uname' +maybe chmod 0755 'update-motd.d/20-release' +maybe chmod 0755 'update-motd.d/40-tail' +maybe chmod 0755 'update-motd.d/50-fortune' +maybe chmod 0755 'update-motd.d/60-ddate' maybe chmod 0644 'updatedb.conf' maybe chmod 0644 'vdpau_wrapper.cfg' maybe chmod 0755 'vim' diff --git a/cron.d/greetings b/cron.d/greetings index a3bf1b4..2d6a091 100644 --- a/cron.d/greetings +++ b/cron.d/greetings @@ -1,3 +1,3 @@ # Eine nette Begrüßung ... -1,11,21,31,41,51 * * * * root test -x /root/bin/generate-motd.sh && /root/bin/generate-motd.sh >/dev/null -@reboot root test -x /root/bin/generate-motd.sh && /root/bin/generate-motd.sh >/dev/null +# 1,11,21,31,41,51 * * * * root test -x /root/bin/generate-motd.sh && /root/bin/generate-motd.sh >/dev/null +# @reboot root test -x /root/bin/generate-motd.sh && /root/bin/generate-motd.sh >/dev/null diff --git a/update-motd.d/20-release b/update-motd.d/20-release new file mode 100755 index 0000000..9bfecd5 --- /dev/null +++ b/update-motd.d/20-release @@ -0,0 +1,9 @@ +#!/bin/bash + +if [[ -f /etc/gentoo-release ]] ; then + cat /etc/gentoo-release +elif [[ -x /usr/bin/lsb_release ]] ; then + /usr/bin/lsb_release -d | sed -e 's/^[ ]*Description[ ]*:[ ]*//' +fi + +# vim: ts=4 expandtab diff --git a/update-motd.d/40-tail b/update-motd.d/40-tail new file mode 100755 index 0000000..d1ba165 --- /dev/null +++ b/update-motd.d/40-tail @@ -0,0 +1,7 @@ +#!/bin/bash + +if [[ -f /etc/motd.tail ]] ; then + cat /etc/motd.tail +fi + +# vim: ts=4 expandtab diff --git a/update-motd.d/50-fortune b/update-motd.d/50-fortune new file mode 100755 index 0000000..15a3c7a --- /dev/null +++ b/update-motd.d/50-fortune @@ -0,0 +1,13 @@ +#!/bin/bash + +export LC_ALL=de_DE.utf8 + +if [[ -x /usr/bin/fortune ]] ; then + echo + /usr/bin/fortune de +elif [[ -x /usr/games/fortune ]] ; then + echo >>"${MOTD}" + /usr/games/fortune de +fi + +# vim: ts=4 expandtab diff --git a/update-motd.d/60-ddate b/update-motd.d/60-ddate new file mode 100755 index 0000000..8a6371e --- /dev/null +++ b/update-motd.d/60-ddate @@ -0,0 +1,9 @@ +#!/bin/bash + +if type -p ddate >/dev/null; then + ddate +fi + +echo + +# vim: ts=4 expandtab -- 2.39.5