aboutsummaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2017-02-24 12:38:17 +0100
committerDavid Runge <dave@sleepmap.de>2017-02-24 12:38:17 +0100
commit5dcfb71633de1df77e70d907b86f592908a5d279 (patch)
tree890d34c7eef3933991740c53b4aa446809e98986 /system
parente6df431d259bc476c968301f34e6e39c5bfe1ad2 (diff)
downloaduenv-5dcfb71633de1df77e70d907b86f592908a5d279.tar.gz
uenv-5dcfb71633de1df77e70d907b86f592908a5d279.tar.bz2
uenv-5dcfb71633de1df77e70d907b86f592908a5d279.tar.xz
uenv-5dcfb71633de1df77e70d907b86f592908a5d279.zip
system/update-motd.*: Adding update-motd service and timer.
Diffstat (limited to 'system')
-rw-r--r--system/update-motd.service23
-rw-r--r--system/update-motd.timer9
2 files changed, 32 insertions, 0 deletions
diff --git a/system/update-motd.service b/system/update-motd.service
new file mode 100644
index 0000000..01871b0
--- /dev/null
+++ b/system/update-motd.service
@@ -0,0 +1,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
+
+
diff --git a/system/update-motd.timer b/system/update-motd.timer
new file mode 100644
index 0000000..fad4731
--- /dev/null
+++ b/system/update-motd.timer
@@ -0,0 +1,9 @@
+[Unit]
+Description=Hourly update of MOTD
+
+[Timer]
+OnCalendar=hourly
+Persistent=true
+
+[Install]
+WantedBy=timers.target