aboutsummaryrefslogtreecommitdiffstats
path: root/system/update-motd.service
blob: 01871b0e95447f70751d5c0f532db713daaf3be2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[Unit]
Description=Update MOTD

[Service]
Type=oneshot
ExecStart=/usr/bin/sh -c 'if [ -s /etc/motd.name ] ; then cat /etc/motd.name > /tmp/motd ; else cat /etc/hostname | banner -w 80 > /tmp/motd && echo >> /tmp/motd ; fi'
ExecStart=/usr/bin/sh -c 'uname -a >> /tmp/motd'
ExecStart=/usr/bin/sh -c 'echo >> /tmp/motd'
ExecStart=-/usr/bin/sh -c 'pacman -Sy 2>&1 > /dev/null'
ExecStart=/usr/bin/sh -c 'echo "Package updates available:" >> /tmp/motd'
ExecStart=-/usr/bin/sh -c 'pacman -Qu >> /tmp/motd'
ExecStart=/usr/bin/sh -c 'echo >> /tmp/motd'
ExecStart=/usr/bin/sh -c 'echo "Security updates needed:" >> /tmp/motd'
ExecStart=/usr/bin/sh -c 'if [ -x /usr/bin/arch-audit ]; then arch-audit -uf "%n|%c" >> /tmp/motd ; else echo "Install arch-audit from AUR!" >> /tmp/motd ; fi'
ExecStart=/usr/bin/sh -c 'if [ -x /usr/bin/lolcat ] ; then lolcat /tmp/motd > /etc/motd ; else mv /tmp/motd /etc/motd ; fi'
PrivateDevices=yes
PrivateTmp=yes
ProtectSystem=full
ReadWriteDirectories=/etc/motd
ProtectHome=yes
NoNewPrivileges=yes