From 63141cfdbc611c50846d725b3b0e0fb5de484f59 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 19 Sep 2023 12:35:08 +0200 Subject: [PATCH] saving uncommitted changes in /etc prior to apt run --- .etckeeper | 6 +++++- cron.d/greetings | 4 ++-- letsencrypt/.certbot.lock | 0 update-motd.d/20-release | 9 +++++++++ update-motd.d/40-tail | 7 +++++++ update-motd.d/50-fortune | 13 +++++++++++++ update-motd.d/60-ddate | 9 +++++++++ update-motd.d/70-need-reboot | 17 +++++++++++++++++ 8 files changed, 62 insertions(+), 3 deletions(-) delete mode 100644 letsencrypt/.certbot.lock 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 create mode 100755 update-motd.d/70-need-reboot diff --git a/.etckeeper b/.etckeeper index eee8410..54ffd85 100755 --- a/.etckeeper +++ b/.etckeeper @@ -1177,7 +1177,6 @@ maybe chown 'openldap' 'ldap/slapd.d/cn=config/olcDatabase={1}mdb.ldif' maybe chgrp 'openldap' 'ldap/slapd.d/cn=config/olcDatabase={1}mdb.ldif' maybe chmod 0600 'ldap/slapd.d/cn=config/olcDatabase={1}mdb.ldif' maybe chmod 0755 'letsencrypt' -maybe chmod 0600 'letsencrypt/.certbot.lock' maybe chmod 0644 'letsencrypt/.updated-options-ssl-apache-conf-digest.txt' maybe chmod 0700 'letsencrypt/accounts' maybe chmod 0700 'letsencrypt/accounts/acme-staging-v02.api.letsencrypt.org' @@ -2097,6 +2096,11 @@ maybe chmod 0644 'ufw/applications.d/salt-master/salt.ufw' 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 0755 'update-motd.d/70-need-reboot' maybe chmod 0644 'updatedb.conf' maybe chmod 0755 'vim' maybe chmod 0644 'vim/vimrc' 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/letsencrypt/.certbot.lock b/letsencrypt/.certbot.lock deleted file mode 100644 index e69de29..0000000 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 diff --git a/update-motd.d/70-need-reboot b/update-motd.d/70-need-reboot new file mode 100755 index 0000000..de73b56 --- /dev/null +++ b/update-motd.d/70-need-reboot @@ -0,0 +1,17 @@ +#!/bin/bash + +CYAN="\033[38;5;14m" +NORMAL="\033[39m" + +if [[ -f /run/reboot-required ]] ; then + echo + echo -e "❗❗😯💣 The host needs to be rebootet! 💣😯❗❗" + echo + if [[ -f /run/reboot-required.pkgs ]] ; then + echo "The following packages were changed:" + for p in $( cat /run/reboot-required.pkgs ) ; do + echo -e " * ${CYAN}${p}${NORMAL}" + done + echo + fi +fi -- 2.39.5