motd/install.sh
2021-04-19 13:09:21 +02:00

11 lines
562 B
Bash
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
truncate -s0 /etc/motd # empty native static motd
mkdir -p /etc/update-motd.d/ # create dedicated directory following ubuntu
cp motd /etc/update-motd.d/ # copy the static motd banner into it
chmod -x /etc/update-motd.d/* # disable any existing script
cp scripts/* /etc/update-motd.d/ # enable claranet motd
echo "For distributions which does not use update-motd (e.g. ubuntu/debian), do not forget to add the following to /etc/pam.d/sshd:"
echo "session optional pam_exec.so stdout /etc/update-motd.d/00-basic"