Skip to content

Instantly share code, notes, and snippets.

@adrianoluis
Last active January 18, 2025 17:01
Show Gist options
  • Save adrianoluis/35d98e592f4628fd33b2b5eec5e3ebf2 to your computer and use it in GitHub Desktop.
Save adrianoluis/35d98e592f4628fd33b2b5eec5e3ebf2 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
rm /etc/motd
rm /etc/update-motd.d/10-uname
sed -i "s/#PrintLastLog yes/PrintLastLog no/" /etc/ssh/sshd_config
systemctl restart sshd
curl -Lo /etc/update-motd.d/10-welcome https://raw.githubusercontent.com/ar51an/raspberrypi-motd/refs/heads/main/update-motd.d/10-welcome
curl -Lo /etc/update-motd.d/15-system https://raw.githubusercontent.com/ar51an/raspberrypi-motd/refs/heads/main/update-motd.d/15-system
curl -Lo /etc/update-motd.d/20-update https://raw.githubusercontent.com/ar51an/raspberrypi-motd/refs/heads/main/update-motd.d/20-update
chmod +x /etc/update-motd.d/10-welcome
chmod +x /etc/update-motd.d/15-system
chmod +x /etc/update-motd.d/20-update
mkdir /etc/update-motd-static.d
curl -Lo /etc/update-motd-static.d/20-update https://raw.githubusercontent.com/ar51an/raspberrypi-motd/refs/heads/main/update-motd-static.d/20-update
chmod +x /etc/update-motd-static.d/20-update
run-parts /etc/update-motd-static.d
curl -Lo /etc/systemd/system/motd-update.service https://raw.githubusercontent.com/ar51an/raspberrypi-motd/refs/heads/main/systemd-timer/motd-update.service
curl -Lo /etc/systemd/system/motd-update.timer https://raw.githubusercontent.com/ar51an/raspberrypi-motd/refs/heads/main/systemd-timer/motd-update.timer
systemctl enable motd-update.timer
systemctl start motd-update.timer
curl -Lo /usr/local/bin/full-system-update https://raw.githubusercontent.com/ar51an/raspberrypi-motd/refs/heads/main/update-os/update.sh
chmod +x /usr/local/bin/full-system-update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment