commit 23ad1380c7f6364a4a4ca5e612d63e630f42b9e6
parent ba2d035482311ff9a4407d0bef0f969ab4895b49
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date: Tue, 26 Jul 2022 15:38:42 +0200
issue-gen script
Diffstat:
1 file changed, 14 insertions(+), 0 deletions(-)
diff --git a/command/issue-gen b/command/issue-gen
@@ -0,0 +1,14 @@
+#!/bin/zsh
+setopt no_unset extended_glob
+exec >/etc/.new.issue.$$
+printf '%s\n' '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'
+ip a | awk '
+/^[0-9]/ { iface = $2; sub(/:$/, "", iface) }
+/link\/ether/ { printf "MAC %s (%s)\n", $2, iface }
+/ scope global/ { gsub(/^ */,"NET "); print }
+'
+for f in /etc/ssh/ssh_host_*_key.pub(N); do
+ printf 'SSH '
+ ssh-keygen -l -f $f
+done
+mv /etc/.new.issue.$$ /etc/issue