issue-gen (680B)
1 #!/bin/zsh 2 setopt no_unset extended_glob 3 exec >/etc/.new.issue.$$ 4 printf '\n%s\n' ' ┌───────────────────────────────────────────────────────────────────────' 5 ip a | awk -v CSI=$'\033[' -v l=$'\033[0m│' ' 6 /^[0-9]/ { iface = $2; sub(/:$/, "", iface) } 7 /link\/ether/ { printf "%s (%s)\n", CSI "33mMAC" l $2, iface } 8 / scope global/ { gsub(/^ */,CSI"36mNET"l); print } 9 ' 10 for f in /etc/ssh/ssh_host_*_key.pub(N); do 11 printf '\033[32mSSH\033[0m│' 12 ssh-keygen -l -f $f 13 done 14 printf '%s\n' '───┘' 15 mv /etc/.new.issue.$$ /etc/issue